[Ffmpeg-devel] [BUG] Invalid Aspect Ratio

Brian Brice bbrice
Thu Nov 2 03:52:49 CET 2006


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.

I was trying to think of a fix for this, but I think quite a few of the
encoders use this type of method.

-- 
Brian Brice




More information about the ffmpeg-devel mailing list