[FFmpeg-devel] [PATCH] demuxer aspect ratio

Aurelien Jacobs aurel
Fri Aug 22 00:22:49 CEST 2008


Currently, when a video must be rendered with non-square pixels, it is
specified in AVCodecContext.sample_aspect_ratio. The problem is that
this field is set by both decoders and demuxers. In some cases, the
demuxer properly set this field with correct SAR, and then the
decoder overwrite it with dumb values.
I think we need an API so that the caller can chose to use either
the value from the decoder or the demuxer (the demuxer one should
generally be preferred if available).
Attached patch adds a AVStream.display_aspect_ratio dedicated to
store the demuxer aspect ratio. For now, I only converted the matroska
demuxer to use this field, as an example. Other demuxers should be
converted too, if this new field is accepted.
Oh, and obviously, I intend to apply this patch in several steps.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: display_aspect_ratio.diff
Type: text/x-patch
Size: 3919 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080822/5508b366/attachment.bin>

More information about the ffmpeg-devel mailing list