0
votes

enter image description here

I am trying to merge two videos together using AVMutableComposition

After scaling the video's i am not finding a way to crop the video or get rid of the part of the video that is marked red. I tried using setCropRect but to no use. Scaling and translation is working fine but i am stuck at cropping. Any suggestions?

1

1 Answers

0
votes

You can use AVVideoCompositing . In video composition there is a property custom compositor . There you can get frame by frame buffer of the videos. And the interesting thing is that you can add multiple videos and for a single time you can get the video frames by track id . Then you can convert the frame buffer into CIImage or Can do in GPU like metal or gpuimage. Here you can draw the frame in the context , You can do anything with the frame buffer like if you use ciimage you can crop it by CICropFilter etc.

Links: https://developer.apple.com/documentation/avfoundation/avvideocompositing?language=objc https://github.com/ElfSundae/AVDemo/tree/master/AVCustomEdit