[FFmpeg-user] Cropping different amounts from top and bottom (or left and right sides)

Thilo Borgmann thilo.borgmann at googlemail.com
Fri Apr 1 12:13:58 CEST 2011


Am 01.04.11 02:20, schrieb Phill Clarke:
> I'm struggling to understand how to crop a different amount from the top and
> bottom of a video. All the documentation and examples seem to show either
> cropping the same amount from both top and bottom or cropping from just top
> or bottom.
> 
> As an example, I have a PAL MPEG2 file at 720x608. The top 32 lines are
> VITC. If I want to convert to PAL DV, then I need to crop just those top 32
> lines.
> 
> -vf crop=720x576 is not good as it takes a centre cut, which is 16 lines off
> both the top and bottom. VITC still visible.

> -vf crop:720x576:0:32 works well and takes 32 lines off the top.

Thus you already know the answer to your question.

"out_w:out_h:x:y"

In the docs you've pointed to:
"The x and y parameters specify the expressions for the position of the top-left
corner of the output (non-cropped) area."


> However, if I use this same file and want to convert to NTSC DV I need a
> resolution of 720x480. That's a reduction of 128 lines from the original. I
> could use:
> 
> -vf crop: 720x408  it works kind of OK, because 64 lines are taken off both
> the top and bottom.
> 
> However, what I really want it to take 80 lines off the top, to account for
> the 32 lines of VITC, and 48 lines off the bottom.

So your parameters for your example should be:

720:408:0:80 for use with PAL DV
or
720:408:0:112 for use with the original

I hope that helps.

-Thilo


More information about the ffmpeg-user mailing list