gst-launch error handling

Florian Lindner mailinglists at xgm.de
Wed Dec 14 04:08:54 PST 2011


I feared that answer. I have already searched the web for a minimal
python example. The "official" examples at
http://pygstdocs.berlios.de/pygst-tutorial/index.html all involve a
lot of GTK code for creating windows etc. I simply find no starting
point with the python API. If I really need that mass of code (like in
the aforementioned examples) for just duplicating that gst-launch
call, I would rather go with executing gst-launch and parse the output
for errors.

Regards,
Florian


2011/12/14 Tim-Philipp Müller <t.i.m at zen.co.uk>:
> On Wed, 2011-12-14 at 12:42 +0100, Florian Lindner wrote:
>
>> 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:
>> ...
>> 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?
>
> If you have a python script, you should probably just use the gstreamer
> python bindings and use pipeline = gst.parse_launch("....") and then
> check for error message on the pipeline's bus (or EOS), either in a
> blocking way (timed_pop) or asynchronously (running a main loop).
>
>  Cheers
>  -Tim
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list