[FFmpeg-devel] [PATCH] demuxer aspect ratio

Aurelien Jacobs aurel
Fri Aug 22 01:23:37 CEST 2008


Michael Niedermayer wrote:

> 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 ...

Oh, indeed. That's something I didn't considered.
Now, I attached the same patch but using sample_aspect_ratio instead of
display_aspect_ratio.

Aurel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample_aspect_ratio.diff
Type: text/x-patch
Size: 3729 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080822/2b016dee/attachment.bin>



More information about the ffmpeg-devel mailing list