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 715137 - avimux: padding granularity field not filled in correctly
avimux: padding granularity field not filled in correctly
Status: RESOLVED INVALID
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-25 07:48 UTC by Dirk Van Haerenborgh
Modified: 2013-11-25 13:03 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dirk Van Haerenborgh 2013-11-25 07:48:20 UTC
Avimux never actually fills the padding granularity field of the AVI header. This is important when working with non-default image sizes, since GStreamer requires each row to be padded to the next 4-byte boundary.
Leaving this field zero results in ffmpeg and vlc interpreting the padding as actual image data, wrapping it onto the next row. This introduces an incremental spatial shift with each new row.

The variable avimux->avi_hdr.pad_gran is there, yet it is never assigned a value.
This could default to 4. I assume there may be some corner cases where 4 is incorrect, but non that I can think of right now.
Comment 1 Sebastian Dröge (slomo) 2013-11-25 08:28:01 UTC
GStreamer defaults to 4 byte aligned strides, but in 1.x this can be any value really if the element supports the GstVideoMeta (avimux does not).
Comment 2 Sebastian Dröge (slomo) 2013-11-25 08:29:57 UTC
Note that this header is per file, not per stream. So not really usable for this problem here.
Comment 3 Dirk Van Haerenborgh 2013-11-25 12:59:36 UTC
Microsoft's standard for the bitmap (BMP) format defines that rows of pixels in a bitmap file must be padded to an integer multiple of 4 bytes:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd318229(v=vs.85).aspx

So, GStreamer is one of the only tools implementing this correctly. Please close this.