[Bug 720659] New: avimux generates wrong 'blockalign'
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Wed Dec 18 01:29:43 PST 2013
https://bugzilla.gnome.org/show_bug.cgi?id=720659
GStreamer | gst-plugins-good | git
Summary: avimux generates wrong 'blockalign'
Classification: Platform
Product: GStreamer
Version: git
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: gst-plugins-good
AssignedTo: gstreamer-bugs at lists.freedesktop.org
ReportedBy: m.olbrich at pengutronix.de
QAContact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
>From what I can tell the avi muxer generates the wrong 'blockalign' in some
situations. I observed this with a audio/mpeg stream generated by voaacenc.
The relevant code is in gst_avi_mux_audsink_set_fields():
[...]
/* FIXME ?? some rumours say this should be largest audio chunk size */
avipad->auds.blockalign = avipad->parent.hdr.scale;
[...]
The comment is at least partially correct: If blockalign is smaller than
the largest audio chunk size then the demuxer gets it wrong. In my case
blockalign is 1024 and sometimes a block is larger than 1024 bytes (this
probably happens because I use voaacenc with bitrate=256000).
The demuxer parses the index and does this in gst_avi_demux_add_index():
[...]
blockalign = stream->strf.auds->blockalign;
if (blockalign > 0)
stream->total_blocks += DIV_ROUND_UP (entry->size, blockalign);
[...]
For any block that is larger than 1024 this results in
"stream->total_blocks += 2" (or more). This is wrong as the block only
contains 1024 samples. As a result, any following block is delayed by the
duration of one block.
It is a cumulative effect. In my use-case this results in an delay of 2
seconds after one hour.
I'm not sure, what the correct value for blockalign is. I see the problem
when playing the relevant files with VLC, MPlayer and GStreamer. I 'fixed'
the Problem by setting:
[...]
avipad->auds.blockalign = avipad->parent.hdr.scale * avipad->auds.channels;
[...]
I'm not sure what the correct value is. For GStreamer any value larger than
the largest audio block size is fine. I have no idea what other
implementations need.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list