38
15
I have a video that shows the following
and I would like to crop it to this:
How can I do it?
38
15
I have a video that shows the following
and I would like to crop it to this:
How can I do it?
61
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 rectangleout_h
is the height of the output rectanglex
and y
specify the top left corner of the output rectangleSo, 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 rate 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
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:
3
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...
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) – Martin Thoma – 2012-11-27T07:16:21.107
People who come to this question might look for software to cut a video (so only the first 10 seconds or something similar). See What to use to quickly cut Audio/Video for that.
– Martin Thoma – 2016-11-01T15:20:13.023What 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 – 2012-11-26T21:11:57.683
I tried to find an application that supports this. I only found
ffmpeg
, butffmpeg -croptop 90 -i original.ogv "output.ogv"
gave meVertical crop dimensions are outside the range of the original image
. I did not find any graphical program for this task. – Martin Thoma – 2012-11-26T21:14:14.407I would be happy if you could name me one program, that does allow me to crop by place, not by time. – Martin Thoma – 2012-11-26T21:15:22.773
Adobe Premiere,
– slhck – 2012-11-26T21:44:26.513ffmpeg
crop filter, Handbrake, QuickTime Pro, iMovie, VirtualDub, VidCrop …1The
ffmpeg
syntax withcroptop
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 – 2012-11-26T21:48:01.913