Perhaps I'm misunderstanding the capabilities of AVComposition
, but I have a task that I am failing to know how to approach.
I have a background video, which is a video of a tree;
I also have a foreground video, which is a video of a horse;
I have a transparent .png mask, which is a circle (shown with background for clarity).
My ideal goal is to create a H.264 video, save to the user's device, that shows the tree in the background, with the horse video masked into a circle.
While I believe using init(asset:applyingCIFiltersWithHandler:)
to apply a CIBlendWithMask
filter could be feasible, I have no idea how I would render the "masked" video (since it would be transparent around the circle) over the background video.