GStreamer stealing my command line args

Florian Lindner mailinglists at xgm.de
Mon Feb 6 13:38:35 PST 2012


Hello,

I'm using gstreamer with python like that:

import gst

def gst_convert(infile, outfile, quality):
    pipe_desc = 'filesrc location="{flac}" ! decodebin2 ! audioconvert
! lamemp3enc quality={quality} encoding-engine-quality=high ! xingmux
! id3v2mux ! filesink location="{mp3}"'.format(
        flac=infile, mp3=outfile, quality=quality)

    pipeline = gst.parse_launch(pipe_desc)
    bus = pipeline.get_bus()
    pipeline.set_state(gst.STATE_PLAYING)
    msg = bus.poll(gst.MESSAGE_EOS | gst.MESSAGE_ERROR, -1)
    pipeline.set_state(gst.STATE_NULL)
    if msg.type == gst.MESSAGE_ERROR:
        raise Exception(msg)


def main():
    parser = generate_argparser()
    args = parser.parse_args()

    [...]


if __name__ == "__main__":
    main()

but what really puzzles me is:

florian at horus ~ % conv.py -h
Aufruf:
  conv.py [OPTION …] - GStreamer initialization

Hilfeoptionen:
  -h, --help                        Hilfeoptionen anzeigen
  --help-all                        Alle Hilfeoptionen anzeigen
  --help-gst                        Die Optionen von GStreamer anzeigen


Why does gstreamer displays it help? def main() is not even called
when started like that.

How can I omit that?

Thanks,

Florian


More information about the gstreamer-devel mailing list