[Ffmpeg-devel] DAR and SAR FFmpeg option confusion

Robert Swain robert.swain
Mon Mar 12 19:57:06 CET 2007


Benoit Fouet wrote:
> Robert Swain wrote:
>> Benoit Fouet wrote:
>>> Robert Swain wrote:

[...]

>>>> I would make a patch but I don't know how to solve this issue.
>>> what issue do you think of ?
>> The issue is that the SAR seemingly cannot be overriden.
>>
> if you use, for instance:
> $ ffmpeg -i foo.mp4 -aspect 4:3 -vcodec h264 bar.mp4
> it works, no ? (at least, it works for me...)

That sets the DAR, not the SAR. While setting -aspect to the output width:height 
does make the SAR get set to 1:1, I'm not really sure this is an acceptable 
solution. In my opinion, people should be able to set the SAR directly.

To set the SAR one needs access to sample_aspect_ratio.num and .den in avctx. It 
would appear that this is not currently possible, and 'aspect' in 
libavcodec/utils.c doesn't affect these parameters yet it claims to be the 
sample aspect ratio option.

Should aspect in utils.c be removed?
Should a new parameter be added for altering the SAR?

Should aspect in utils.c be 'fixed' to actually set the SAR?

I'm leaning towards the former because that would avoid the confusion of two 
options named aspect.

Rob




More information about the ffmpeg-devel mailing list