Reputation: 34523
What's the right way to add an image overlay to a video created with AVAssetWriter?
It's possible to do so with AVAssetExportSession, but this question is about how to do so with AVAssetWriter so there is more control over the quality and output.
There are two scenarios:
1) Simple: Add single overlay that is present the entire duration of the video (similar to a watermark).
2) Complex: Add different overlays that animate in and out of the video at different times (similar to using AVVideoCompositionCoreAnimationTool).
Upvotes: 7
Views: 4404
Reputation: 2505
There's a lot of different approaches to this and the correct answer is going to depend on exactly what your use case is.
At a high level, here's three approaches:
If you need some further info, then if you add some clarification on what you're trying to do, I may be able to expand this answer to add more detail on the appropriate approach.
Upvotes: 7