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 415446 - [avidemux] fails parsing mjpeg file from digital camera
[avidemux] fails parsing mjpeg file from digital camera
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal normal
: 0.10.6
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-03-06 20:49 UTC by René Stadler
Modified: 2007-03-08 16:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The file in question (276.50 KB, video/x-msvideo)
2007-03-06 20:50 UTC, René Stadler
  Details
Make avidemux accept optional header chunks in any order (4.55 KB, patch)
2007-03-07 03:07 UTC, René Stadler
committed Details | Review

Description René Stadler 2007-03-06 20:49:33 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.
Comment 1 René Stadler 2007-03-06 20:50:38 UTC
Created attachment 84118 [details]
The file in question
Comment 2 René Stadler 2007-03-07 03:07:12 UTC
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.
Comment 3 Wim Taymans 2007-03-08 16:01:57 UTC
        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.