Domanda

I am merging multiple videos together using AVAssetExportSession but the videos are in stereo and the resulting video is in dual mono. Is it possible to use AVAssetExportSession to merge videos and maintain the stereo channels? I see it is possible to merge in stereo using AVAssetWriter and

AudioChannelLayout stereoChannelLayout = {.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo,
                .mChannelBitmap = 0,
                .mNumberChannelDescriptions = 0
            };

to make it stereo but I am using AVMutableVideoCompositionLayerInstruction with the AVAssetExportSession to handle video positioning within the merge so it would be ideal if there was a way to do it with AVAssetExportSession.

È stato utile?

Soluzione

I found that you can replace AVAssetExportSession with SDAVAssetExportSession. You can then specify audio settings as you would for the AVAssetWriter while leveraging the benefits of the AVAssetExportSession.

I had to change __weak typeof(self) wself = self; to __weak SDAVAssetExportSession * wself = self; on line 172 of SDAVAssetExportSession.m.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top