Generic error of GStreamer

Tim-Philipp Müller t.i.m at zen.co.uk
Sun Jun 9 03:57:05 PDT 2013


On Sat, 2013-06-08 at 15:30 +0200, Marco Trapanese wrote:

Hi,

> Debian 6, 32-bit. From command line I issue:
> 
> gst-launch-0.10 filesrc location=/home/marco/Video/video.mp4 ! 
> decodebin2 ! ffmpegcolospace ! xvimagesink
> 
> and I can watch the video.
> Now I run the same pipeline in Qt4:
> 
> QGst::ElementPtr src = QGst:ElementFactory::make("filescr");
> src->setProperty("location", "/home/marco/Video/video.mp4");
> QGst::ElementPtr decoder = QGst:ElementFactory::make("decodebin2");
> QGst::ElementPtr colorspace = QGst:ElementFactory::make("ffmpegcolorspace");
> QGst::ElementPtr sink = QGst:ElementFactory::make("xvimagesink");
> 
> QGst::PipelinePtr pipeline = QGst::Pipeline::create();
> pipeline->add(src);
> pipeline->add(decoder);
> pipeline->add(colorspace);
> pipeline->add(sink);
> src->link(decoder);
> decoder->link(colorspace);
> colorspace->link(sink);
> 
> QGst::BusPtr bus = pipeline->bus();
> bus->addSignalWatch();
> QGLib::connect(bus, "message", this, &Player::onBusMessage);
> pipeline->setState(QGst::StatePlaying);
> 
> The error is: " GStreamer encountered a general stream error".

You might also want to look at the 'debug' detail string of the error
message - it gives a bit more information. I suspect it might say
something about 'not-linked' in this case.

> It seems the same pipeline. Why it should not work?

decodebin2 has dynamic pads which will only be created after you start
up the pipeline. gst-launch handles this magically under the hood. I
suspect this call:

  decoder->link(colorspace);

fails. Anyway, just use playbin2 - much easier (create it, set the "uri"
property, set it to playing state).

Cheers
 -Tim



More information about the gstreamer-devel mailing list