GNOME Bugzilla – Bug 415446
[avidemux] fails parsing mjpeg file from digital camera
Last modified: 2007-03-08 16:01:57 UTC
Launch line: gst-launch-0.10 filesrc location=D0012030.AVI ! avidemux ! fakesink Output: Setting pipeline to PAUSED ... Pipeline is PREROLLING ... 0:00:00.575871000 19136 0x80ed768 ERROR avidemux gstavidemux.c:1169:gst_avi_demux_parse_stream:<avidemux0> Failed to find strh chunk (bufsize: 216, tag: strd) ERROR: from element /pipeline0/decodebin0/avidemux0: Internal data stream error. Additional debug info: gstavidemux.c(3681): gst_avi_demux_loop (): /pipeline0/decodebin0/avidemux0: streaming stopped, reason error ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... (gst-launch-0.10:19136): GStreamer-CRITICAL **: gst_pad_push_event: assertion `GST_IS_PAD (pad)' failed FREEING pipeline ... I think that playback should work since the Wii as well as MPlayer have no problems with that file. The file was created by a cheap digital camera.
Created attachment 84118 [details] The file in question
Created attachment 84135 [details] [review] Make avidemux accept optional header chunks in any order The problem is that avidemux does not like the fact that the strd chunk precedes the strh chunk. The current parsing logic as implemented in gst_avi_demux_parse_stream is as follows: parse_chunk (&tag) if tag != strh: goto fail parse_strh (); parse_chunk (&tag) if tag != strf: goto fail do_strh_and_strf_stuff () while parse_chunk (&tag): switch tag: case strd: do_strd_stuff () break; case other_tags: do_other_tag_stuff (); break; The patch collates this into a single while loop, leaving the logic as: got_strh = FALSE got_strf = FALSE while parse_chunk (&tag): switch tag: case strh: if got_strh: warning ("duplicate strh chunk") break got_strh = TRUE parse_strh () break; case strf: if got_strf: warning ("duplicate strf chunk") break if not got_strh: error ("got strf before strh") goto fail do_strh_and_strf_stuff () break case strd: do_strd_stuff () break; case other_tags: do_other_tag_stuff (); break; if not got_strh: goto fail if not got_strf: goto fail This should preserve the current parsing semantics except that optional chunks can occur before the strh and strf chunks.
Patch by: René Stadler <mail at renestadler dot de> * gst/avi/gstavidemux.c: (gst_avi_demux_parse_stream), (gst_avi_demux_push_event), (gst_avi_demux_process_next_entry), (gst_avi_demux_stream_data), (gst_avi_demux_chain): Make avidemux accept optional header chunks in any order. Fixes #415446.