Merging two m4v Movie Files Using AVMutableComposition - Videos Will Not Merge

前端 未结 2 1344
暖寄归人
暖寄归人 2021-01-21 11:46

I am using the below code to try and merge two m4v files stored in the documents folder :

CMTime insertionPoint = kCMTimeZero;
NSError * error = nil;

AVMutableC         


        
相关标签:
2条回答
  • 2021-01-21 12:13

    You havent set the composition to the exportSession.

    After the line:

    AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:composition presetName:AVAssetExportPresetHighestQuality];

    Add this line

    exportSession.videoComposition = composition;

    This should solve your problem.

    0 讨论(0)
  • 2021-01-21 12:35

    Ok - so I eventually got this working by using individual AVMutableComposition tracks and then setting a mutablecomposition for audio and one for video.

    0 讨论(0)
提交回复
热议问题