Take the 2-minute tour ×
Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It's 100% free, no registration required.

I want to crop the video at some position and move the part next to the part that wasn't cropped. (See image, it explains better)

example

http://i.imgur.com/qhSZy.png

share|improve this question
    
I'm not sure I understand. You want to move lower half of the frame to the right side? On each frame? In that case you'd turn from portrait mode to landscape (to use photography terms) and screw up initial resolution? And... what software you have at disposal? –  dandellion Sep 22 '12 at 11:02
    
I have VirtualDub. –  Blastcore Sep 22 '12 at 13:48

2 Answers 2

up vote 1 down vote accepted

You'll need to use something different, other than VirtualDub. Sony Vegas 8+ comes to my mind.

In Sony Vegas you can put your video, rotate it, crop it and fit the first upper part in the left side of the video. I am assuming that you are going to use a 16:9 aspect ratio video project for this case, so you can use the left side of the canvas in order to put the first part of your video.

In another row in the time line, you can add the same video, rotate it, crop it and fit the right side of the project. This way, you can put the parts of the video in whatever position, rotation, size, zoom, etc. as you wish.

I suggest you to run a search on youtube with the words "Sony Vegas Pan Crop Tutorial" in order to find useful tricks on how to do this. I was about to suggest you some of them but they doesn't cover exactly your need. Nevertheless, learning how to pan/crop a video you can achieve this task.

Good luck!

share|improve this answer

FFmpeg can do anything :D

ffmpeg -i input.mp4 \
-filter_complex '[0:v]split[top][bottom];[bottom]crop=iw:ih/2:0:ih/2[right];[top]crop=iw:ih/2:0:0,pad=iw*2:ih:0:0[left];[left][right]overlay=W/2:0[outv]' \
-map [outv] -c:v libx264 -crf 22 -preset veryfast output.mp4

The split filter creates two identical versions of the input video ([0:v]), called [top] and [bottom] for the purposes of the filtergraph. The first crop cuts the top half of [bottom] off, creating an output called [right]; the second crop removes the bottom half of [top], then sends it to the pad filter, which doubles the width of the video frame to the right and creates an output [left]. Finally, [left] and [right] are sent to the overlay filter, which places [right] on top of [left], on top of the black area created by the pad filter, creating the final output [outv].

Unfortunately I can't put a line break in the -filter_complex, since that would break the command.

-map [outv] tells ffmpeg to use the video output of the complex filtergraph; if you want to use the input audio too, you can use -map 0:a as well. All the -c:v and so on are video settings.

Here's a slightly shorter, but less clear version of the above command:

ffmpeg -i input.mp4 \
-filter_complex 'split[top][bottom];[bottom]crop=iw:ih/2:0:ih/2[right];[top]crop=iw:ih/2:0:0,pad=iw*2:ih:0:0,[right]overlay=W/2:0' \
-c:v libx264 -crf 22 -preset veryfast output.mp4
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.