You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use filter on video. thats why is use VideoIO. filter work but the problem is transition.
` func videoFilterSet(){
guard let result = result else{
return}
let context = try! MTIContext(device: MTLCreateSystemDefaultDevice()!)
let handler = MTIAsyncVideoCompositionRequestHandler(context: context, tracks: result.composition.tracks, on: .main) { request in
self.filter.inputImage = request.anySourceImage
return self.filter.outputImage!
}
let composition = VideoComposition(propertiesOf: result.composition, compositionRequestHandler: handler.handle(request:))
let playerItem = AVPlayerItem(asset: result.composition)
playerItem.videoComposition = composition.makeAVVideoComposition()
player.replaceCurrentItem(with: playerItem)
self.player.seek(to: .zero)
self.player.replaceCurrentItem(with: playerItem)
self.player.play()
}`
please see this code for filter
The text was updated successfully, but these errors were encountered:
I want to use filter on video. thats why is use VideoIO. filter work but the problem is transition.
` func videoFilterSet(){
guard let result = result else{
return}
please see this code for filter
The text was updated successfully, but these errors were encountered: