Dividing a video clip by 4 areas

adobe-premierevideovideo conversionvideo editing

I am working on a program that can playback a video clip in 4 phones. For this I need to supply each phone with a part of the video clip.

Lets say I have a 1080p clip and I have 4 phones. Then I want to divide or split this clip in 4 different areas and upload each area to each phone. Something like this:

enter image description here

So, what I mean is I should have 4 parts of the movie, lets say top right, top left, bottom right and bottom left.

Can you please tell me what kind of software is capable of doing such task?

Best Answer

This can be done using ffmpeg with its crop filter. Using a command line tool makes it easy to automate the process or run it from another program or script. It also has a library API.

These commands will create the four videos, one for each quadrant, each with a full copy of the audio. (Use -an instead of -acodec copy to drop the audio.) You can use any supported video format in place of mp4.

ffmpeg -i in.mp4 -vf crop=iw/2:ih/2:0:0 -acodec copy v1.mp4
ffmpeg -i in.mp4 -vf crop=iw/2:ih/2:iw/2:0 -acodec copy v2.mp4
ffmpeg -i in.mp4 -vf crop=iw/2:ih/2:0:ih/2 -acodec copy v3.mp4
ffmpeg -i in.mp4 -vf crop=iw/2:ih/2:iw/2:ih/2 -acodec copy v4.mp4

crop parameters = width : heigth : start x-axis : start y-axis

Related Question