[FFmpeg-cvslog] Write aspect ratio when muxing gif.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Apr 4 07:23:36 CEST 2014


On 03.04.2014, at 23:48, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> Reimar Döffinger <Reimar.Doeffinger <at> gmx.de> writes:
> 
>> On 02.04.2014, at 22:53, Carl Eugen Hoyos wrote:
>> 
>>> +    if (sar.num > 0 && sar.den > 0) {
>>> +        aspect = sar.num * 64 / sar.den - 15;
>>> +        if (aspect < 0 || aspect > 255)
>>> +            aspect = 0;
>>> +    }
>> 
>> Not a big deal, but have you considered clamping to 
>> 1..255 instead of setting to 0? Because I find it a 
>> bit strange that like this 0.5 aspect would work, 
>> but 0.1 suddenly will look like no aspect again.
> 
> Imo, we should not set an aspect ratio if it is 
> not correct, but I may miss something...

Define "correct". You will have rounding errors for lots of values, I'd consider this just one more case.
Also it's a bit about usability and least surprise: how should a user know (and possibly catch) that any aspect value below a certain magic constant will be ignored?
How would the user even know what value this "magic constant" has?


More information about the ffmpeg-cvslog mailing list