After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 539482 - [avidemux] Doesn't parse vprp ODML header
[avidemux] Doesn't parse vprp ODML header
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.9
Assigned To: Mark Nauwelaerts
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-21 16:24 UTC by Bastien Nocera
Modified: 2008-06-29 22:29 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Bastien Nocera 2008-06-21 16:24:31 UTC
The vprp ODML header can contain aspect ratio information. This information is currently ignored.

typedef struct _gst_riff_vprp_video_field_desc {
  guint32  CompressedBMHeight;
  guint32  CompressedBMWidth;
  guint32  ValidBMHeight;
  guint32  ValidBMWidth;
  guint32  ValidBMXOffset;
  guint32  ValidBMYOffset;
  guint32  VideoXOffsetInT;
  guint32  VideoYValidStartLine;
} gst_riff_vprp_video_field_desc;

typedef struct _gst_riff_vprp {
  guint32         VideoFormatToken;
  guint32        VideoStandard;
  guint32        dwVerticalRefreshRate;
  guint32        dwHTotalInT;
  guint32        dwVTotalInLines;
  guint32        dwFrameAspectRatio;
  guint32        dwFrameWidthInPixels;
  guint32        dwFrameHeightInLines;
  guint32        nbFieldPerFrame;
  gst_riff_vprp_video_field_desc FieldInfo[nbFieldPerFrame];
} gst_riff_vprp;

And from the specs at http://www.the-labs.com/Video/odmlff2-avidef.pdf:
The aspect ratio is stored as a DWORD value with a word each storing the x:y ratio. For example, 1 to 1 is 0x00010001. Standard values for television is 4:3 or 16:9. This value can be used with the frame width and height to calculate the pixel aspect ratio.
Comment 1 Edward Hervey 2008-06-26 09:27:54 UTC
Do  you have a video that uses that and currently fails ?
Comment 2 Bastien Nocera 2008-06-26 23:00:56 UTC
I loaded up a video, scaled the video to have square pixels (from 704x456 to 456x456). Then I added vprp headers using mencoder:
$ mencoder -idx 'test.avi' -ovc copy -oac copy -o vprp-aspect-ratio.avi -force-avi-aspect 704:456

MPlayer itself shows the right sized window, but the video is still 1:1.

File is at:
http://www.gnome.org/~hadess/vprp-aspect-ratio.avi
Comment 3 Mark Nauwelaerts 2008-06-29 19:54:01 UTC
2008-06-29  Mark Nauwelaerts  <mark.nauwelaerts@collabora.co.uk>

	* gst/avi/avi-ids.h:
	Add vprp chunk related structures.
	* gst/avi/gstavidemux.c: (gst_avi_demux_riff_parse_vprp),
	(gst_avi_demux_parse_stream):
	Parse optional vprp chunk and add calculated pixel-aspect-ratio
	to caps.  Fixes #539482.
	* gst/avi/gstavimux.h:
	* gst/avi/gstavimux.c: (gst_avi_mux_pad_reset),
	(gst_avi_mux_vidsink_set_caps), (gst_avi_mux_riff_get_avi_header):
	Add a vprp chunk if non-trival pixel-aspect-ratio provided in caps.
Comment 4 Bastien Nocera 2008-06-29 22:29:57 UTC
Works great, thanks Mark.