[FFmpeg-devel] [PATCH] demuxer aspect ratio

Michael Niedermayer michaelni
Fri Aug 22 00:48:23 CEST 2008

On Fri, Aug 22, 2008 at 12:22:49AM +0200, Aurelien Jacobs wrote:
> Hi,
> 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

sample_aspect_ratio is strongly preferred over display.
It is much easier to work with as it does not change when croping or adding
borders. Also when rendering a frame into another that can be done when the
sample_aspect_ratio matches, it cannot when not without scaling ...

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080822/9c52019d/attachment.pgp>

More information about the ffmpeg-devel mailing list