Can AVFoundation
be used to create compositions on the fly?
Scenario: I have five 10-second H.264 clips that I want to play with a nice 1-second fade/transition between them. Is there a means to create a composition with the first two, begin playing the composition, then add the third while the composition is playing? Also, deleting the stale/viewed clips from the composition as they're no longer needed would be desirable.
I can't find anything in the API (eg. "AVMutableVideoComposition
") that permits "mutable" transitions on-the-fly.
My requirements are to create a playlist... that could consist of many (eg. 200) short video elements, all played in sequence with transitions between each. I also suspect that AVQueuePlayer
could be brought to bear on this.
An alternate solution would be to create a pair of AVPlayer
/AVPlayerLayer
objects that could overlap and would, in effect, play alternating AVAssets
.
My need would be to intercept video/audio frames as they're playing via CMSampleBuffer
and a CVPixelBufferRef
and apply real-time video effects as well.