[gst-devel] Python gst without GTK

Olivier Aubert olivier.aubert at liris.cnrs.fr
Mon Dec 6 16:46:20 CET 2010


Hello

You should run the mainloop from the gobject module:

import gobject

# Setup your gstreamer pipeline
[...]
# Handle keypress
gobject.io_add_watch(sys.stdin, gobject.IO_IN, handle_keypress)
# Run the mainloop
gobject.MainLoop().run()


Olivier

On Wed, 2010-11-17 at 21:18 +0100, Jens Gottstein wrote:
> Hi,
> 
> I am trying to write a command line player using gstreamer in python
> 
> In the example below, the on_message() is never called?
> 
> Can anybody tell me what I did wrong?
> 
> #!/usr/bin/python
> 
> import pygst
> pygst.require("0.10")
> import gst
> 
> def on_message(self, bus, message):
>      print "on_message"
> 
> player = gst.element_factory_make("playbin2", "player")
> bus = player.get_bus()
> bus.add_signal_watch()
> bus.connect("message", on_message)
> player.set_property("uri", "file:///usr/share/sounds/KDE_Error_3.ogg")
> player.set_state(gst.STATE_PLAYING)
> 
> raw_input("anykey")
> 
> 
> 
> I am using debian, GStreamer Python bindings 0.10.12 "A Wild Finish"
> 
> Thanks a lot
> 
> ------------------------------------------------------------------------------
> What happens now with your Lotus Notes apps - do you make another costly 
> upgrade, or settle for being marooned without product support? Time to move
> off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
> use, and manage than apps on traditional platforms. Sign up for the Lotus 
> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel






More information about the gstreamer-devel mailing list