ffdec

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Nov 1 16:19:51 PDT 2011


On Wed, 2011-11-02 at 09:58 +1100, Thierry Panthier wrote:

Hi Thierry,

> I'm using the latest version of gst-ffmpeg (0.10.12) and I've been
> getting the following error from ffdec_mjpeg:
> 
> "ffmpeg gstffmpegdec.c:2748:gst_ffmpegdec_chain:<ffdec_mjpeg7>
> warning: ffdec_mjpeg: input format was not set before data start"
> 
> This only happens in certain scenarios, normally when the system is
> busy (over 50% of CPU usage).
> 
> After adding more verbose logging to gstffmpegdec.c I found out that
> *sometimes* the function "gst_ffmpegdec_chain" gets called *before*
> the function "gst_ffmpegdec_setcaps".
> 
> Why this happens I still don't know. It might be because of the
> multi-threaded nature of GStreamer but at the moment I don't have time
> to debug the rest of the library.
> 
> The problem is that "gst_ffmpegdec_setcaps" is responsible for calling
> "gst_ffmpegdec_open", which initializes the decoder. And since the
> decoder is not initialized when "gst_ffmpegdec_chain" is called, the
> function raises an error and returns GST_FLOW_ERROR.
> 
> So I implemented a small patch that simply prints a warning message
> and discards the buffer when that happens. The plugin now works fine
> for me.
> 
> I'd like to know if you agree with this implementation.

This doesn't sound right at first glance.

It sounds like the problem is upstream. It should've sent a buffer with
caps set on it. There might be a problem with an element upstream and/or
you're missing a typefind element or parser somewhere.

 Cheers
  -Tim




More information about the gstreamer-devel mailing list