I consider this a good test case for this bug. Same problem whether you use Python2 or Python3 (but for Novacut, we care about Python3). Currently this script will fail with:
TypeError: unknown type GstMessage
#!/usr/bin/python3
from gi.repository import GObject
GObject.threads_init()
I consider this a good test case for this bug. Same problem whether you use Python2 or Python3 (but for Novacut, we care about Python3). Currently this script will fail with:
TypeError: unknown type GstMessage
#!/usr/bin/python3
from gi.repository import GObject threads_ init()
GObject.
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()