[FFmpeg-user] Command line option to convert to square pixels?

Jamie Tufnell diesql at googlemail.com
Fri Nov 18 18:06:31 CET 2011


How can I convert to square pixels IF necessary, AND maintain height
based the input file's display aspect ratio?

I want to force the width of the output file, but set height based on
the input file's display aspect ratio and convert to square pixels if
necessary.

Right now I use -vf "scale=640:-1" and I want to extend that to
convert to square pixels as well.

e.g. the same command line option would have the following effects:

(no square pixel conversion necessary)
in: 1440x810 PAR 1:1 DAR 16:9   => out: 640x360 PAR 1:1 DAR 16:9
in: 1440x1080 PAR 1:1 DAR 4:3   => out: 640x480 PAR 1:1 DAR 4:3

(convert to square pixels)
in: 1440x1080 PAR 4:3 DAR 16:9  => out: 640x360 PAR 1:1 DAR 16:9

Is there a way to do this?

Thanks!


More information about the ffmpeg-user mailing list