[英]Switching between multiple video tracks in a AVMutableComposition
Is there a way to switch between multiple video tracks in an AVMutableComposition
? 有没有办法在AVMutableComposition
多个视频轨道之间切换? I want to assign a different preferredTransform
to each, and switch between them. 我想给每个分配一个不同的preferredTransform
,并在它们之间切换。
I tried it by assigning alternating assets to an A track and a B track, but no video showed for the B track time. 我通过将替代资产分配给A轨道和B轨道来进行尝试,但在B轨道时间内没有视频显示。
It looks like to perform the switching between multiple video tracks ("video downmixing") you need to use AVAssetWriter
. 看起来您需要使用AVAssetWriter
在多个视频轨道之间进行切换(“视频AVAssetWriter
混”)。 According to the docs the class has "automatic interleaving of media data for multiple concurrent tracks". 根据文档 ,该类具有“针对多个并发轨道的媒体数据自动交织”。
So, if you want to preview a composition using multiple video tracks, you either need to write it out using AVAssetWriter
or compose it in an AVMutableComposition
using a single video track only. 因此,如果要使用多个视频轨道预览构图,则需要使用AVAssetWriter
将其写出,或AVMutableComposition
使用单个视频轨道在AVMutableComposition
进行构图。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.