gst-launch error handling

Florian Lindner mailinglists at xgm.de
Wed Dec 14 03:42:43 PST 2011


Hello,

I plan to use gst-launch in a simple python script that mass converts
flac to mp3 files. I would use it like that:

gst-launch-0.10 filesrc location=accept.flac ! decodebin !
audioconvert ! lamemp3enc ! xingmux ! id3v2mux ! filesink
location=out.mp3

How can I do error handling if any of the pipeline modules produce an
error? e.g. I've modified the flac file to be invalid, that produces
that output:


florian at horus ~/testconv % gst-launch-0.10 filesrc
location=accept.flac ! decodebin ! audioconvert ! lamemp3enc ! xingmux
! id3v2mux ! filesink location=out.mp3
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstFlacDec:flacdec0:
Could not decode stream.
Additional debug info:
gstflacdec.c(666): gst_flac_dec_error_cb ():
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstFlacDec:flacdec0:
unknown error (3)
Execution ended after 11017569 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...


Returncode is 0. How to detect an error? Parse output for ERROR?

I know that gst-launch is not intended for applications, but in my
simple case using the python interface with the event loop and all
that stuff seems to be a bit too much. Or have I mistaken the API
docs?

Thanks,

Florian


More information about the gstreamer-devel mailing list