avassetwriter

Recording gapless audio with AVAssetWriter

陌路散爱 提交于 2021-02-18 02:50:15
问题 I'm trying to record segments of audio and recombine them without producing a gap in audio. The eventual goal is to also have video, but I've found that audio itself creates gaps when combined with ffmpeg -f concat -i list.txt -c copy out.mp4 If I put the audio in an HLS playlist, there are also gaps, so I don't think this is unique to ffmpeg. The idea is that samples come in continuously, and my controller routes samples to the proper AVAssetWriter . How do I eliminate gaps in audio? import

Audio Missing when Adding Text on pixelBuffer

牧云@^-^@ 提交于 2021-01-28 08:18:26
问题 I am trying to add text overlay on video, When recording in iPhone 5s or lower devices in High quality and writing text on that then after 1 or 2 seconds audio goes missing, But this doesn't happen on larger devices like iPhone 6/6s. If i remove that text writer method then it works properly on all devices or if i reduce the video quality in 5s then also it works fine. How i can get video with audio in iPhone 5s with overlay text. Here is my code import Foundation import AVFoundation import

Recording video with iOS broadcasting extension

我怕爱的太早我们不能终老 提交于 2021-01-20 04:48:30
问题 I'm trying to tweak the iOS broadcasting extension feature to record the video instead of live streaming. It seems possible because you can get pixel buffer in processSampleBuffer:withType: method. Then I have coded like below but it fails when appending the buffer. I'm familiar neither to AVAssetWriter nor App Extension programming so I cannot figure out what's wrong here. Am I doing something we're not supposed to do in the extension? Or the usage of AVAssetWriter is wrong? Any idea is

Recording video with iOS broadcasting extension

懵懂的女人 提交于 2021-01-20 04:48:06
问题 I'm trying to tweak the iOS broadcasting extension feature to record the video instead of live streaming. It seems possible because you can get pixel buffer in processSampleBuffer:withType: method. Then I have coded like below but it fails when appending the buffer. I'm familiar neither to AVAssetWriter nor App Extension programming so I cannot figure out what's wrong here. Am I doing something we're not supposed to do in the extension? Or the usage of AVAssetWriter is wrong? Any idea is

AVAssetWritter First Frames are either Blank or black

故事扮演 提交于 2021-01-07 01:28:47
问题 Problem: I am recording video frames by getting both audio and video buffers from CMSampleBuffer . Once the AssetWriter has finished writing the buffers, the final video results in first frame being black or either blank(considering it only considers the audio frames in the beginning). Although, randomly the video comes out totally normal and doesnt have a black frame. What I tried: I tried to wait until I fetch the first video frame and then start recording. Yet I get the same erratic

AVAssetWriter Unable to record audio with video | Crashing

回眸只為那壹抹淺笑 提交于 2021-01-05 08:55:53
问题 I am trying to capture video/Audio frames from CMSampleBuffer but completely failing to obtain a proper video recording. Expected Output: A Video file in .mp4 format that has both audio(from the mic) and video frames. Current Output: An Empty Directory/A video file without audio. Crashes on Run : Media type of sample buffer must match receiver's media type ("soun") I tried almost everything available online to troubleshoot this. I have a deadline coming and I just pulling my hair trying to

Seamless audio recording while flipping camera, using AVCaptureSession & AVAssetWriter

蓝咒 提交于 2020-11-29 08:30:52
问题 I’m looking for a way to maintain a seamless audio track while flipping between front and back camera. Many apps in the market can do this, one example is SnapChat… Solutions should use AVCaptureSession and AVAssetWriter. Also it should explicitly not use AVMutableComposition since there is a bug between AVMutableComposition and AVCaptureSession ATM. Also, I can't afford post processing time. Currently when I change the video input the audio recording skips and becomes out of sync. I’m

Issue with AVAssetWriter Input: MPEG4

生来就可爱ヽ(ⅴ<●) 提交于 2020-07-20 10:16:12
问题 I am compressing videos with AVAssetWriter. If i set the video compression file to Quicktime movie it works fine, however i would like to export it to MPEG4, but it gives me this error while running: In order to perform passthrough to file type public.mpeg-4, please provide a format hint in the AVAssetWriterInput initializer' Here is the specific code where i declare the file type: let videoInputQueue = DispatchQueue(label: "videoQueue") let audioInputQueue = DispatchQueue(label: "audioQueue"

Issue with AVAssetWriter Input: MPEG4

百般思念 提交于 2020-07-20 10:14:05
问题 I am compressing videos with AVAssetWriter. If i set the video compression file to Quicktime movie it works fine, however i would like to export it to MPEG4, but it gives me this error while running: In order to perform passthrough to file type public.mpeg-4, please provide a format hint in the AVAssetWriterInput initializer' Here is the specific code where i declare the file type: let videoInputQueue = DispatchQueue(label: "videoQueue") let audioInputQueue = DispatchQueue(label: "audioQueue"