[FFmpeg-user] Problem with vf pad ... help please

Mark Himsley mark at mdsh.com
Sun Sep 16 22:58:42 CEST 2012


On 16/09/2012 18:14, PyProg PyProg wrote:
> 2012/9/16 Mark Himsley <mark at mdsh.com>:
> 
>> Not according to ffmpeg:
>>
>> Input #0, avi, from '/home/toto/blender/dronez.avi':
>>   Duration: 00:03:11.24, start: 0.000000, bitrate: 1536 kb/s
>>     Stream #0:0: Video: mpeg4 (DX50 / 0x30355844), yuv420p, 720x576
>>
>> Your original video is a 4:3 standard definition 720x576 file. You might
>> have a video player (QuickTime, for instance) that lies slightly and tells
>> you the file is 768x576 because it knows that standard definition pixels are
>> not square (although Apple should scale up to 788x576, but that's another
>> argument).
> 
>> I'm sure I will get flack for this - but this is the way I would scale that
>> video (keeping your pink border):
>>
>> -vf scale=984:720:interl=1,pad=1280:720:148:0:0xd28080
>>
>> Those numbers might be unfamiliar to many, but retains the video's display
>> aspect ratio to within 0.07%.
> 
> My calculations of the moment are:
> 
> For a final 16:9 disposition with a 4/3 original video ... calculate:
> 
> * Calculation of the width (after scale): height x (4.0 / 3.0) ->
> here: 720.0 * (4.0 / 3.0) ==> 960.0

You are falling into the trap that the all of the pixels on a 720x576
line are part of the active 4:3 picture. Where as only 702 pixels are.

If you wish to ignore the calculated scale and pad values I gave you
above, and insist on sticking with your calculated numbers, then you
(like many before you and many to follow) will get the will get the
images 2.5% too narrow. I'm sure that will flatter most people, being
2.5% too thin, but it is wrong. Please believe the experience of 26
years at the BBC.


> * Calculating the size (width) of each band for example the left band):
> (1280.0 - 960.0) / 2.0 ==> 160.0
> --> band_width = (final_width - intermediate_width) / 2.0
> 
> Here in FFmpeg:
> 
> toto at toto-kubuntu:~$
> /home/toto/ekd_toto/linux_dependances_portables/ffmpeg/ffmpeg  -i
> "/home/toto/blender/big_buck_bunny_4_3.avi" -vf
> "scale=960:720:interl=1,pad=1280:720:160:0:0xa05f41,setdar=16:9"
> -sameq -y "/home/toto/a/nouv_EKD/video/version_3/filtres_vidéo/15_09_12_bd_ext_1280x720_16_9.avi"

-- 
Mark


More information about the ffmpeg-user mailing list