dividing a video clip by 4 areas

6

1

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?

Sean87

Posted 2013-08-09T21:25:13.257

Reputation: 464

Answers

6

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

mark4o

Posted 2013-08-09T21:25:13.257

Reputation: 4 729

+1 Tried to added the correct syntax. Roll back if I made a mistake. – nixda – 2013-08-16T08:25:08.130

See the documentation for the full crop syntax. http://ffmpeg.org/ffmpeg-filters.html#crop

– mark4o – 2013-08-16T14:53:07.483

@mark4o I think the crop argument is wrong, somehow 3 of the outputs look the same – Sean87 – 2013-11-04T12:42:36.710

@Saeid87: It's working for me. You can also specify numbers if you know the width and height. – mark4o – 2013-11-04T22:00:57.923

0

Pretty much any video editor will let you crop a video to a rectangle.

For example, in the free VirtualDub, open your video, use Video / Filter to add the 'Null Transform' filter, then specify the crop using the Cropping button.

If you wish for something more automatic, you can use the commercial TMPGEnc 4.0 XPress which accepts AviSynth scripts that can do crop.

harrymc

Posted 2013-08-09T21:25:13.257

Reputation: 306 093

0

I would suggest Handbrake although it isn't "intuitive" on how to crop.

In Handbrake, you load your video clip, then at the Cropping section you set alternately the Top, Bottom, Left and Right sizes to match.

For the first pane, you would have Bottom = 540 and Right = 960 (since it's a 1080p = 1920x1080) and so forth for the remaining.

Doktoro Reichard

Posted 2013-08-09T21:25:13.257

Reputation: 4 896