I am using AVAssetWriter, AVAssetWriterInput, and AVAssetWrinterInputPixelBufferAdaptor to take an X number of UIImages and export them to a movie. The problem I am running into is that the video exports with no audio track. How can you add a muted audio track to AVAssetWriter?
Asked
Active
Viewed 572 times
0
-
Why do you want to add a muted audio track? you can export the video without audio track. – Inhan Dec 23 '15 at 01:34
-
@Legna I am sending the exported clips to an audio and video AVMutableCompositionTrack. I'm trying to avoid having empty gaps in the audio track. – Ivan Lesko Dec 23 '15 at 17:30
-
Did you ever figure this out? Having similar issue where the gaps aren't their when playing on android devices, but are (as they should be) with IOS. So I'm figuring putting a muted track to my first scene will stop this mis-sync. – berr08 Dec 13 '17 at 03:31
-
1@berr08 I didn't figure out the source of the problem but there is a work around. I created silent CMSampleBufferRef's to the audio track. See this question for reference: https://stackoverflow.com/questions/34441648/create-a-silent-audio-cmsamplebufferref – Ivan Lesko Dec 13 '17 at 17:53