[FFmpeg-user] Can I do scaling better?
james.darnley at gmail.com
Fri Feb 14 17:05:16 CET 2014
On 2014-02-14 16:55, csparker247 wrote:
>> I cannot provide you with a quick solution but
>> "-vf scale,scale" seems a very bad idea to me.
> I've had concerns with that, too, but I can't think of another way to
> guarantee square pixels AND scale downs for arbitrary inputs.
You can access the aspect ratio in the "scripting" so you can scale
width and height using it.
I will post what I used fairly recently. It is not exactly what you
want but shows the principle. It will scale everything larger than
1024x768 to something that fits within that bound. Otherwise it just
scales to square pixels.
> w=if(lt(dar\,1.34)\, -1\, if(gt(iw\,1024)\, 1024\, iw)):
> h=if(gte(dar\,1.34)\, -1\, if(gt(ih\,768)\, 768\, ih)),
It still didn't solve the odd sizes it that -1 can give.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 683 bytes
Desc: OpenPGP digital signature
More information about the ffmpeg-user