[FFmpeg-devel] [PATCH] Incorrect aspect ratio in MPEG2 essence

Erik Johansson erik.c.johansson at gmail.com
Thu Dec 4 13:11:08 CET 2014


Setting setting sample_aspect_ratio in AVContext does not produce the
expected aspect index value in the MPEG2 sequence header.

Problem seems to be around line 263 in mpeg12enc.c. Setting the
sample_aspect_ratio to 16/9 leads the current error minimization
routine to determine that

error -= (1LL<<32)*(221/100)*(1080/1920)

is smaller than

error -= (1LL<<32)*(16/9)*(1080/1920)

thus picking aspect index value 4 rather than 3.

Proposed fix in attached patch.

Erik Johansson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpeg2_aspect.patch
Type: application/octet-stream
Size: 825 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141204/c3a8bfee/attachment.obj>

More information about the ffmpeg-devel mailing list