dividing a video clip by 4 areas

dividing a video clip by 4 areas

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:

Bildbeschreibung hier eingeben

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?

Antwort1

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

Antwort2

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.

Antwort3

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.

verwandte Informationen