[Ffmpeg-devel] DAR and SAR FFmpeg option confusion

Måns Rullgård mans
Tue Mar 13 10:27:12 CET 2007

Roman Shaposhnik <rvs at sun.com> writes:

> On Tue, 2007-03-13 at 02:41 +0000, Robert Swain wrote:
>> >   Well, that's the point -- if the API Michael mentioned is all we've
>> > got, how do I specify that I need a SAR of 10:11 ? Currently, I see no
>> > way of feeding libavcodec with DISPLAY FRAME WIDTH (704) while at the
>> > same time having an actual ENCODED frame size being bigger (720). Again,
>> > it could be that I'm missing something so I'd love to be educated 
>> > (and use the knowledge to fix the DV codec once and for all).
>> That's the point, the SAR of 10:11 is correct for the 704x480
>> pixels to be displayed with an aspect ratio of 4:3. But you have
>> 720x480 pixels, so you assume the SAR of 10:11 (because the sample
>> aspect ratio is constant through any cropping/padding process,
>> which is basically what is happening as you're padding 8 extra
>> pixels to the left and right of the frames) and calculate your DAR
>> from that, which is 15:11. Try your NTSC 4:3 DV stream that is
>> 720x280 with -aspect 15:11.
>   I see your point now and it does make sense. That said, I guess
> my biggest concern would be that starting to demand DAR being 15:11 
> for 4:3 DV (or anything else for that matter) might be problematic from
> a usability standpoint plus it might present a problem as far as
> flagging 4:3 in various containers is concerned.
>   But I guess, if admitting DAR being 15:9 instead of 4:3 is our 
> official "party line" I would protest too loudly ;-)  

The problem with DV appears to be that it is outright lying about the
aspect ratios.  Given two of DAR, SAR and size, the third can be
easily calculated.  The numbers you gave are inconsistent.  We can't
easily "fix" it as mathematics won't bend very easily.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list