VideoIO icon indicating copy to clipboard operation
VideoIO copied to clipboard

How to use multiple video assets in this code example.

Open VarinderSH opened this issue 3 years ago • 0 comments

let context = try! MTIContext(device: MTLCreateSystemDefaultDevice()!) let handler = MTIAsyncVideoCompositionRequestHandler(context: context, tracks: asset.tracks(withMediaType: .video)) { request in return FilterGraph.makeImage { output in request.anySourceImage => filterA => filterB => output }! } let composition = VideoComposition(propertiesOf: asset, compositionRequestHandler: handler.handle(request:)) let playerItem = AVPlayerItem(asset: asset) playerItem.videoComposition = composition.makeAVVideoComposition() player.replaceCurrentItem(with: playerItem) player.play()

VarinderSH avatar Jan 04 '23 12:01 VarinderSH