I want to read in a video asset on disk and a bunch of processing on it, things like using a CICropFilter
on each individual frame and cutting out a mask, splitting up one video into several smaller videos, and removing frames from the original track to "compress" it down and make it more gif-like.
I've come up with a few possible avenues:
AVAssetWriter
andAVAssetReader
In this scenario, I would read in the CMSampleBuffer
s from file, perform my desired manipulations, then write back to a new file using AVAssetWriter
.
AVMutableComposition
Here, given a list of CMTimes
I can easily cut out frames and rewrite the video or even create multiple compositions for each new video I want to create, then export all of them using AVAssetExportSession
.
The metrics I'm concerned about: performance and power. That is to say I'm interested in the method that offers the greatest efficiency in performing my edits while also giving me the flexibility to do what I want. I'd imagine the kind of video editing I'm describing can be done with both approaches but really I want the most performant/with the best capabilities.