The app I'm working on, editing video files and merging them into an AVComposition.
This is done in a fairly straightforward manner which has been well documented:
Create an AVMutableComposition …
Create video and audio tracks.
Insert video and audio segments on these tracks.
Create an AVVideoComposition object. Popular with team instructions.
I am now interested in adding filters to my AVComposition (presented in an AVPlayer and later exported to an mp4 file).
The only way to add a filter to an AVComposition I could find was to use the AVMutableVideoComposition videoCompositionWithAsset: applyingCIFiltersWithHandler initializer.
However, as others have noted, initialization of AVMutableVideoComposition in this way cannot add the necessary team instructions later.
More, I can't find a way to set a starting point and duration for the assigned filter (but this is less of a problem for me at this point.)
All the resources I've found using filters in AVFoundation, does not use merged videos, rather use the filter on a video asset.
I have tried to use AVComposition as this asset, but without being able to use the layer instructions, the result is useless.
Any idea how to make such a composition that merges videos and also can use a filter (sepia …, brightness, etc.).
I found this link, but it is not clear:
When attempting to initialize
I get the following errors / exceptions:
[AVCoreImageFilterCustomVideoCompositor startVideoCompositionRequest:] Expect video compilation to contain only AVCoreImageFilterVideoCompositionInstruction & # 39;