[gst-devel] gstreamer python

Edward Hervey bilboed at gmail.com
Wed Sep 26 12:33:26 CEST 2007


Hi,

  the programs exits straight away because you're not running a
mainloop. Look deeper at the examples in gst-python, you'll notice
they either do a loop of their own, or use a gobject.GMainLoop().

  Edward

P.S. cc-ed on the gstreamer mailing-list, which is where these kind of
questions should be asked.

On 9/26/07, patrick <puredata at 11h11.com> wrote:
> hi,
>
> maybe i should use a forum to post this basic question, but i am taking
> my chance with you. hope it's okay.
>
> i am trying to use the gstreamer python binding for audio playback (in
> jack - on linux). your tutorial works really well (the gtk audio
> player). but i am trying to begin with command line first. here's my
> really simple program but it quits when i start it do you know why?
>
>
> import pygst
> pygst.require("0.10")
> import gst
>
> def on_message(bus, message):
>         t = message.type
>         if t == gst.MESSAGE_EOS:
>             player.set_state(gst.STATE_NULL)
>         elif t == gst.MESSAGE_ERROR:
>             player.set_state(gst.STATE_NULL)
>
> player = gst.element_factory_make("playbin", "player")
> fakesink = gst.element_factory_make('fakesink', "my-fakesink")
> player.set_property("video-sink", fakesink)
> bus = player.get_bus()
> bus.add_signal_watch()
> bus.connect('message', on_message)
>
> player.set_property('uri', "file:///home/pat/test.mp3")
> player.set_state(gst.STATE_PLAYING)
>
>
>
> cheers and thank you!~
> pat
>


-- 
Edward Hervey
Multimedia editing developer
http://www.pitivi.org/




More information about the gstreamer-devel mailing list