This project has moved. For the latest updates, please go here.

help with cropping video

Mar 2, 2013 at 3:44 AM
I'd like to create a custom profile that will crop tickers from the bottom of the screen, about 120 pixels. Can anyone help me with the ffmpeg filter command, and how to input this syntax into a custom profile? Thanks.
Coordinator
Mar 2, 2013 at 4:49 AM
First add

SkipCropping=true

This is make MCEBuddy skip over auto crop. Then add your custom crop filter to ffmpeg -vf section (remember, order if important, crop before or after resizing)
Coordinator
Mar 2, 2013 at 4:54 AM
The final filter would look something like

-vf yadif=0:-1,hqdn3d,crop=iw:ih-120:0:0

How Crop Filter works
-vf crop=width:height:x:y
Width and height is the dimesions of the cropped image after cropping. X and y is the coordinate of the upper left corner of the cropping rectangle where x=0 corresponds to left edge of original frame and y=0 the top edge of the original frame.
Example:
Original frame is 1280x720. You want to crop 10 pixels from top and bottom but leave the width uncropped:
-vf crop=1280:700:0:10
Here the new height after cropping is 700 pixels and the upper left corner of the cropped image is placed at x=0 and y=10 on the original frame. Since the new height is 20 pixels less than the original it will crop 10 pixels at top and bottom. See it like a crop tool where you first set the dimensions of the cropping rectangle and then place the rectangle somewhere in the original picture where the coordinates x and y is where to place the cropping rectangle based on upper left corner of the rectangle.
I think your example is only cropping 10 pixels from bottom because you place the cropping rectangle at top left of the original image and then reduce the height of the cropped image to 10 pixels less than the original. So the post in your link is probably wrong, because I don't see how that should work. To crop only 20 pixels from bottom (as the poster asked for) he should use:
-vf crop=iw:ih-20:0:0
To crop 20 pixels from bottom and 20 pixels from top:
-vf crop=iw:ih-40:0:20
Mar 13, 2013 at 4:16 PM
Thanks. That's the best explanation that I've seen on how ffmpeg cropping works. Worked perfectly.