当使用AVMutableComposition进行谱曲,那么直接对视频轨道使用preferredTransform属性即可。如果是对整个谱曲进行设置,则通过AVMutableVideoComposition给exportSession进行全局设置。
AVMutableComposition
If you are using an
AVMutableComposition
to edit your visual assets, you can set thepreferredTransform
property on any of the video tracks (AVMutableCompositionTrack
).AVMutableVideoComposition
If you are using an
AVMutableVideoComposition
to edit the video tracks in a video composition, use anAVMutableVideoCompositionLayerInstruction
object 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