[FFmpeg-user] Can I do scaling better?

csparker247 csparker247 at gmail.com
Thu Feb 13 16:25:54 CET 2014


I have a shell script for batch encoding that needs to work on a variety of
media (HD, SD, anamorphic). I crafted a scale cmd that converts everything
to square pixels and limits output videos to 1920x1080, but never scales
higher than the input resolution. It looks like this:

-vf "scale=iw*sar:ih,
scale='if(gt(iw,ih),min(1920,iw),-1)':'if(gt(iw,ih),-1,min(1080,ih))'"

The first scale is the conversion to square pixels. The second scale checks
whether the video is wider than it is tall. If it is, it sets the width to
the smallest value between 1920 and the internal width, and height is
proportional to that. If it's taller than it is wide, it sets the height to
the minimum between 1080 and the internal height, and width is proportional
to that.

But that command line looks like nonsense and I have issues with anamorphic
SD sources getting values not divisible by two. Is there a better way for me
to accomplish the same thing AND end up with even pixel dimensions?



--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Can-I-do-scaling-better-tp4663866.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list