Cross fading in AVMutableVideoComposition

I have successfully created an AVMutableComposition with several videos and can view it and export it, and I would like to be able to switch between them using cross fading, so I want to use AVMutableVideoComposition. I can’t find examples of how to organize and play several AVAsset videos in a row. Does anyone have an example of how to add tracks to AVMutableVideoComposition with the equivalent of AVMutableComposition insertTimeRange or how to set up crossfade?

[self.composition insertTimeRange:CMTimeRangeMake(kCMTimeZero,asset.avAsset.duration)
                                         ofAsset:asset.avAsset
                                          atTime:self.composition.frameDuration
                                           error:nil]
+3
source share
1 answer

AVEditDemo Apple WWDC 2010.

https://developer.apple.com/library/ios/samplecode/AVCustomEdit/Introduction/Intro.html

, : AVMutableComposition, AVMutableVideoComposition. AVMutableComposition, insertTimeRange, . AVMutableVideoComposition AVMutableVideoCompositionLayerInstructions . , AVPlayer AVPlayerItem, AVMutableComposition, AVMutableVideoComposition.

, api - MPMoviePlayer AVPlayer AVComposition , , AVVideoComposition - .

+11

Source: https://habr.com/ru/post/1767350/


All Articles