Actually this issue with message::eos and other messages is fixed with Gstreamer 1.0 aka currently as Gstreamer 0.11.91-2 on Ubuntu 12.10 (note you need previously install gstreamer1.0 packages).
You can verify this with this slightly modified code:
#!/usr/bin/python3
from gi.repository import GObject
GObject.threads_init()
import gi
try:
gi.require_version('Gst', '1.0')
except ValueError:
print 'Could not find required Gstreamer 1.0 library.'
sys.exit(1)
Actually this issue with message::eos and other messages is fixed with Gstreamer 1.0 aka currently as Gstreamer 0.11.91-2 on Ubuntu 12.10 (note you need previously install gstreamer1.0 packages).
You can verify this with this slightly modified code:
#!/usr/bin/python3
from gi.repository import GObject threads_ init()
GObject.
import gi require_ version( 'Gst', '1.0')
try:
gi.
except ValueError:
print 'Could not find required Gstreamer 1.0 library.'
sys.exit(1)
from gi.repository import Gst
Gst.init(None)
mainloop = GObject.MainLoop()
pipeline = Gst.Pipeline()
def on_eos(bus, msg): set_state( Gst.State. NULL)
print('eos: {!r}'.format(msg))
pipeline.
mainloop.quit()
def on_message(bus, msg):
print('message: {!r}'.format(msg))
bus = pipeline.get_bus() signal_ watch() 'message: :eos', on_eos) 'message' , on_message)
bus.add_
bus.connect(
bus.connect(
bus = pipeline.get_bus() signal_ watch() 'message: :eos', on_eos)
bus.add_
bus.connect(
src = Gst.ElementFact ory.make( 'videotestsrc' , None) property( 'num-buffers' , 10) ory.make( 'fakesink' , None)
src.set_
sink = Gst.ElementFact
pipeline.add(src)
pipeline.add(sink)
src.link(sink)
pipeline. set_state( Gst.State. PLAYING)
mainloop.run()