[英]AVAssetExportSession merge videos with stereo
I am merging multiple videos together using AVAssetExportSession
but the videos are in stereo and the resulting video is in dual mono. 我正在使用
AVAssetExportSession
将多个视频合并在一起,但视频是立体声的,结果视频是双声道的。 Is it possible to use AVAssetExportSession
to merge videos and maintain the stereo channels? 是否可以使用
AVAssetExportSession
合并视频并维护立体声通道? I see it is possible to merge in stereo using AVAssetWriter
and 我看到可以使用
AVAssetWriter
和立体声进行合并
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
. 使它成为立体声,但我使用
AVMutableVideoCompositionLayerInstruction
与AVAssetExportSession
来处理合并中的视频定位,所以如果有办法用AVAssetExportSession
这样做将是理想的。
I found that you can replace AVAssetExportSession
with SDAVAssetExportSession
. 我发现你可以用
AVAssetExportSession
替换SDAVAssetExportSession
。 You can then specify audio settings as you would for the AVAssetWriter
while leveraging the benefits of the AVAssetExportSession
. 然后,您可以指定音频设置,你会为
AVAssetWriter
同时利用的好处AVAssetExportSession
。
I had to change __weak typeof(self) wself = self;
我不得不改变
__weak typeof(self) wself = self;
to __weak SDAVAssetExportSession * wself = self;
to
__weak SDAVAssetExportSession * wself = self;
on line 172 of SDAVAssetExportSession.m
. 在
SDAVAssetExportSession.m
第172 SDAVAssetExportSession.m
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.