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 323286 - [ffdec_cinepak] chef.avi causes gstreamer to hang in preroll
[ffdec_cinepak] chef.avi causes gstreamer to hang in preroll
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other All
: Normal major
: 0.10.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-12-05 16:53 UTC by Christian Fredrik Kalager Schaller
Modified: 2005-12-23 14:42 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
GST_DEBUG log (828.65 KB, application/x-bzip2)
2005-12-05 16:59 UTC, Christian Fredrik Kalager Schaller
Details

Description Christian Fredrik Kalager Schaller 2005-12-05 16:53:16 UTC
Please describe the problem:
Trying to play attached chef.avi file it always hangs in preroll phase both with
gst-launch and with Totem.

Steps to reproduce:
 gst-launch-0.10 filesrc location="chef.avi" ! decodebin ! ffmpegcolorspace !
xvimagesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Christian Fredrik Kalager Schaller 2005-12-05 16:59:02 UTC
Created attachment 55644 [details]
GST_DEBUG log
Comment 2 Christian Fredrik Kalager Schaller 2005-12-05 16:59:19 UTC
http://www.linuxrising.org/chef/chef.avi 
Comment 3 Tim-Philipp Müller 2005-12-05 19:25:59 UTC
This is an AVI with cinepak video and raw int 8bpp mono audio.

The reason it doesn't preroll properly seems to be that ffdec_cinepak drops all
the frames it decodes because it is waiting for a keyframe that never comes.

The following fixes it sort of, but needs to be double-checked before being
applied (not tested against any other codecs yet, just wanted to report my
preliminary findings):

Index: gstffmpegdec.c
===================================================================
RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdec.c,v
retrieving revision 1.130
diff -u -p -r1.130 gstffmpegdec.c
--- gstffmpegdec.c      5 Dec 2005 13:04:39 -0000       1.130
+++ gstffmpegdec.c      5 Dec 2005 19:20:06 -0000
@@ -1100,7 +1100,7 @@ gst_ffmpegdec_sink_event (GstPad * pad,
           ffmpegdec->waiting_for_key = TRUE;
         }
       }
-      ffmpegdec->waiting_for_key = TRUE;
+      ffmpegdec->waiting_for_key = FALSE;
       ffmpegdec->synctime = ffmpegdec->next_ts;
       break;
     }

Audio/Video sync also doesn't seem to be quite right with this fix, but it's
really hard to tell anyway, so I'm not sure whether there's an issue or not.

Comment 4 Edward Hervey 2005-12-06 10:44:29 UTC
I had a look at it too, and in fact the cinepak ffmpeg codec never sets the
AVFrame->type to anything. On the other hand it always sets AVFrame->reference
to 1. I have a pending patch which checks not only for type == I_TYPE, but also
for reference == 1.
I tried it over a lot of files and it seems to work. I should also try seeking
with it to see if it doesn't break anything.
The problem is that there are FOUR different variables that ffmpeg codec can set
in a AVFrame structure to give information about the decoded frame. I already
had to file a patch for dvvideo in ffmpeg, and cinepak seems to have the same
problem. So instead of fixing it upstream (although it would be nice), it might
be wiser to find out which of those four values are actually used and what
combination means that the decoded frame is really a keyframe.
Comment 5 Edward Hervey 2005-12-07 12:16:45 UTC
Fixed in cvs. Keyframes are now determined as follow:
iskeyframe = ((ffmpegdec->picture->pict_type == FF_I_TYPE) ||
(ffmpegdec->picture->reference))

I tried it with many files (with the testsuite and totem), and I don't think it
broke anything.