"import pygst" compromises use of optparse

Dan danmbox at gmail.com
Fri Nov 22 12:25:28 PST 2013


>> So pygst (or gst) seem to compromise usage of optparse unless you
>> parse options before anything else. Is there a way to avoid this
>> behavior?
>
> Yes, this was a known problem with the 0.10 (and 0.8) Python bindings
> for GStreamer and couldn't be changed properly because it would break
> backwards compatibility with existing code.
>
> The solution for this would be to move to the 1.x versions of GStreamer
> and use the new bindings available for that. You should do that anyway,
> as 0.10 is no longer supported by the GStreamer project since a long
> time.

Yeah, about that. As I'm developing for a hardware platform that only
has gst 0.10, upgrading is not an option. It's not like developers can
always force users to upgrade frameworks -- not even for desktop folks
:)

The solution is to import optparse and build an OptionParser before
importing pygst. Which is not too bad *once you know the problem*.

-- Dan


More information about the gstreamer-devel mailing list