Loop AVMutableCompositionTrack

后端 未结 3 669
深忆病人
深忆病人 2021-02-04 21:15

I have got two audio tracks on me that I combine with one another like this:

AVMutableComposition *composition = [[AVMutableComposition alloc] init];

AVMutableC         


        
3条回答
  •  Happy的楠姐
    2021-02-04 21:53

    On the Gaurav response you should change this line:
    audioDuration = CMTimeSubtract(totalDuration,videoDuration);

    to:
    audioDuration = CMTimeSubtract(videoDuration,currentTime);

    Otherwise the audiotrack will be longer than the video ( that will be just black )

提交回复
热议问题