[Ffmpeg-devel] [BUG] Invalid Aspect Ratio

Måns Rullgård mru
Thu Nov 2 04:04:48 CET 2006


Brian Brice <bbrice at newtek.com> writes:

> Hello.
>
> I have encoded 1280x720 MPEG 2 clips that have an aspect ratio of
> 16:9.  The aspect ratio in the file always comes out to 1 in this
> case though.
>
> ffmpeg -i INPUT.avi -an -f mpeg2video -vcodec mpeg2video -s 1280x720
> -aspect 16:9 -b 18300k OUTPUT.mpg
>
> I do believe this is due to the conversion in ffmpeg.c:
> video_enc->sample_aspect_ratio =
> av_d2q(frame_aspect_ratio*video_enc->height/video_enc->width, 255);
>
> (16 / 9) * (720 / 1280) = 1
>
> Then the method of choosing the best aspect ratio in the MPEG encoder
> of course chooses what corresponds to 1:1.

And this is all correct.  MPEG2 video can specify SAR=1, or DAR as one
of 4:3, 16:9 and 2.21:1, or leave it unspecified.  In your case, the
encoder is choosing to code SAR=1, just like it should.

-- 
M?ns Rullg?rd
mru at inprovide.com




More information about the ffmpeg-devel mailing list