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
.
I found that you can replace
AVAssetExportSession
withSDAVAssetExportSession
. You can then specify audio settings as you would for theAVAssetWriter
while leveraging the benefits of theAVAssetExportSession
.I had to change
__weak typeof(self) wself = self;
to__weak SDAVAssetExportSession * wself = self;
on line 172 ofSDAVAssetExportSession.m
.