Reputation: 8066
What is the method of cropping and combining video using AVFoundation? I need to crop away x number of pixels from the top (of a video) and fill that potion of the video with a different video. Is this possible?
Upvotes: 2
Views: 382
Reputation: 11469
Yes, it's possible, but tricky. You need to:
It's all very messy. These slides will help you through it:
http://www.slideshare.net/invalidname/advanced-av-foundation-cocoaconf-aug-11
Upvotes: 1
Reputation: 8757
Unfortunately, no. There's no way to crop or mask video on the fly in AVFoundation. You could translate the video down the render area (effectively 'cropping' the bottom) using AVMutableVideoComposition
and AVMutableVideoCompositionLayerInstruction
s setTransform:atTime:
Upvotes: 0