Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a video that shows the following

enter image description here

and I would like to crop it to this:

enter image description here

How can I do it?

share|improve this question
    
What have you tried yet and where did you get stuck? I'm sure there are dozens of tools that allow cropping video, so it might help to ask a more specific question, else we get a list of software that crops video – which is considered not constructive –  slhck Nov 26 '12 at 21:11
    
I tried to find an application that supports this. I only found ffmpeg, but ffmpeg -croptop 90 -i original.ogv "output.ogv" gave me Vertical crop dimensions are outside the range of the original image. I did not find any graphical program for this task. –  moose Nov 26 '12 at 21:14
    
I would be happy if you could name me one program, that does allow me to crop by place, not by time. –  moose Nov 26 '12 at 21:15
    
Adobe Premiere, ffmpeg crop filter, Handbrake, QuickTime Pro, iMovie, VirtualDub, VidCrop –  slhck Nov 26 '12 at 21:44
1  
The ffmpeg syntax with croptop is quite old and won't be supported in any somewhat recent versions. You'll need to use the -filter:v command, see FFmpeg documentation. –  slhck Nov 26 '12 at 21:48

2 Answers 2

up vote 8 down vote accepted

Cropping with FFmpeg

With FFmpeg, cropping works as follows, using the crop filter:

ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4

Where the options are as follows:

  • out_w is the width of the output rectangle
  • out_h is the height of the output rectangle
  • x and y specify the top left corner of the output rectangle

So, for example, to crop a 640×480 window, starting from position (100, 100), you'd do:

ffmpeg -i in.mp4 -filter:v "crop=640:480:100:100" out.mp4

Be aware that FFmpeg will re-encode the video using x264, when the MP4 container is selected. With no additional options, this defaults to a constant quality factor (CRF) set to 23. To increase the quality—which could be necessary for screen recordings with sharp edges and text—use a lower value, maybe go down to 18:

ffmpeg -i in.mp4 -filter:v "crop=640:480:100:100" -crf 18 out.mp4

Note that on Ubuntu, if you apt-get install ffmpeg, you will not get FFmpeg, but a fork of it called Libav with the avconv binary. It's roughly the same tool, but just keep in mind there's a difference. Use a static build from the download page if you want a more recent, "real" FFmpeg version.


Cropping with Handbrake

Handbrake is a free and open source cross-platform tool with a GUI. Load the input file, then use the Picture Settings to specify the crop:

You can use the Preview Window to visually adjust the crop.

Here, you can also adjust the output quality with the Constant Quality slider:

share|improve this answer

Did you use Ubuntu's default recordMyDesktop tool? If so, click "Select Window" and then draw a rectangle on the thumbnail it shows of your current desktop. This area will be recorded. This is not "cropping a video" but "cropping a scene" but I think it should solve your problem at hand...

share|improve this answer
    
As I have started the program inside of VirtualBox and I want to record it from the outside, I can't select the window. So this answer doesn't help (btw.: yes, I used recordmydesktop, but without a GUI which makes choosing a window quite difficult) –  moose Nov 27 '12 at 7:16

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.