ffdec

Thierry Panthier thierry.devel at gmail.com
Tue Nov 1 15:58:03 PDT 2011


Hello everyone,

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.


cd gst-ffmpeg-0.10.12/
patch -p0 < ../gstffmpegdec.patch


Regards,

Thierry Panthier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gstffmpegdec.patch
Type: text/x-patch
Size: 602 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20111102/bbbe9464/attachment.bin>


More information about the gstreamer-devel mailing list