GNOME Bugzilla – Bug 662949
[h264parse] Doesn't use PAR from bitstream
Last modified: 2011-12-01 08:10:30 UTC
We don't read (and even less use) the pixel aspect ratio from the codec bitstream.
Created attachment 200193 [details] [review] codecparser: Compute pixel-aspect-ratio Avoids callers having to dig the info in the VUI
Created attachment 200194 [details] [review] h264parse: If the bitstream provides a pixel-aspect-ratio, use it
You should only use the in-stream PAR if there's no PAR inside the container (or upstream for that matter). The same applies to the framerate too. (That's at least the behaviour we implement in most/all decoders and I think parsers should be the same)
I can modify it so that it only overrides it if the upstream PAR is 1/1. This is what gst-ffmpeg does, and makes sense.
If upstream provides a PAR it should really use that PAR. If (in the case of qtdemux) upstream doesn't really know the PAR it should simply not set the PAR on the caps. Elements should be able to trust the caps provided by upstream. So, set the PAR from the h264 stream only if upstream didn't put a PAR field into the caps. This requires a change in qtdemux and the same should be changed in the ffmpeg decoders too
Some containers have PAR set that is wrong, but it is still set. Shouldn't PAR from stream take precedence?
Usually the PAR from the container is the more correct one
commit 4474db4e71007c47a54af0e497ed500f4affb96e Author: Alessandro Decina <alessandro.d@gmail.com> Date: Thu Dec 1 09:02:46 2011 +0100 h264parse: let upstream PAR override in-stream PAR commit 21b063a78c6edfcd9ab1f1ea23ff1efb55ba85bf Author: Alessandro Decina <alessandro.decina@collabora.co.uk> Date: Wed Nov 23 18:26:44 2011 +0100 h264parse: rework PAR parsing And in the process refactor _update_src_caps a bit commit 6d85d4882aafbdc5701551923b76dafa353dd332 Author: Luciana Fujii Pontello <lucianafujii@collabora.co.uk> Date: Wed Nov 16 00:03:12 2011 -0500 h264parse: respect pixel-aspect-ratio Parse pixel-aspect-ratio in vui information.