当使用AVMutableComposition进行谱曲,那么直接对视频轨道使用preferredTransform属性即可。如果是对整个谱曲进行设置,则通过AVMutableVideoComposition给exportSession进行全局设置。
AVMutableComposition
If you are using an
AVMutableCompositionto edit your visual assets, you can set thepreferredTransformproperty on any of the video tracks (AVMutableCompositionTrack).AVMutableVideoComposition
If you are using an
AVMutableVideoCompositionto edit the video tracks in a video composition, use anAVMutableVideoCompositionLayerInstructionobject to modify the transform to apply to a given track in the video composition. Use thesetTransform:atTime:method to set a value of the transform at a time within the time range of the instruction, or use thesetTransformRampFromStartTransform:toEndTransform:timeRange:method to set a transform ramp to apply during a given time range.
https://developer.apple.com/library/archive/qa/qa1744/_index.html