GNOME Bugzilla – Bug 539482
[avidemux] Doesn't parse vprp ODML header
Last modified: 2008-06-29 22:29:57 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.
Do you have a video that uses that and currently fails ?
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
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.
Works great, thanks Mark.