Lack of GstMiniObject means Gst.Message is broken, can't get EOS signal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| Novacut |
High
|
Unassigned | ||
| pygobject |
Expired
|
Medium
|
||
| pygobject (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
It's almost possible to use GStreamer from PyGI. The hang up is that currently you can't get EOS signals from a pipeline, and that the message bus is overall broken.
As far as I know, this is because pygobject doesn't grok the GstMiniObject type, which mean Gst.Message is an unknown type. There is an upstream bug with a patch (work in progress):
https:/
I'm not sure if this would be too invasive a change to deliver to Oneiric users through a SRU, but this would help smooth the transition to PyGI (and possibly only shipping Python3 on the CD) for Precise as app devs could be working with PyGI and GStreamer right now on Oneiric.
For what it's worth, this would really help Novacut. Either way, lets make sure PyGI + GStreamer rocks in Precise!
(Side note: this also raises a question... GStreamer 0.10 or 1.0 in Precise?)
ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: python3-gobject 3.0.0-0ubuntu2
ProcVersionSign
Uname: Linux 3.0.0-12-generic x86_64
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Thu Oct 13 15:24:09 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Beta amd64 (20110921.2)
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: pygobject
UpgradeStatus: No upgrade log present (probably fresh install)
Jason Gerard DeRose (jderose) wrote : | #1 |
Jason Gerard DeRose (jderose) wrote : | #2 |
Changed in pygobject: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in novacut: | |
importance: | Undecided → High |
status: | New → Triaged |
milestone: | none → 11.10 |
Launchpad Janitor (janitor) wrote : | #3 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in pygobject (Ubuntu): | |
status: | New → Confirmed |
ChristianSchaller (uraeus) wrote : | #4 |
Tried this in GStreamer 0.11 and apart from having to change gst.STATE_NULL to Gst.State.NULL, it seems to work fine there :)
Changed in novacut: | |
milestone: | 11.10 → 11.11 |
Changed in pygobject (Ubuntu): | |
status: | Confirmed → Triaged |
Changed in novacut: | |
milestone: | 11.11 → 12.01 |
Changed in novacut: | |
milestone: | 12.01 → 12.02 |
Changed in novacut: | |
milestone: | 12.02 → 12.03 |
Changed in novacut: | |
milestone: | 12.03 → none |
Martin Pitt (pitti) wrote : | #5 |
Just a note, gstreamer 0.10 works very poorly with GI. This has been worked on in gstreamer 0.11 git head, where it works reasonably well, but there is no chance that this will ever work in 0.10. Please use the static bindings in the python-gst0.10 package.
Jason Gerard DeRose (jderose) wrote : | #6 |
Martin,
Yeah, I haven't updated this bug for a while... I marked it as "invalid" for Ubuntu as this isn't an issue that gstreamer or python-gi can really fix anyway in 0.10.
I've had great luck so far with gstreamer 0.11 and PyGI, and using Python3 to top it off.
Thanks!
Changed in novacut: | |
status: | Triaged → Won't Fix |
Changed in pygobject (Ubuntu): | |
status: | Triaged → Invalid |
Angel Guzman Maeso (shakaran) wrote : | #7 |
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.
import gi
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):
print('eos: {!r}'.format(msg))
pipeline.
mainloop.quit()
def on_message(bus, msg):
print('message: {!r}'.format(msg))
bus = pipeline.get_bus()
bus.add_
bus.connect(
bus.connect(
bus = pipeline.get_bus()
bus.add_
bus.connect(
src = Gst.ElementFact
src.set_
sink = Gst.ElementFact
pipeline.add(src)
pipeline.add(sink)
src.link(sink)
pipeline.
mainloop.run()
Could fix be backported? Something abnormal is that we can not use python+
Jason Gerard DeRose (jderose) wrote : | #9 |
Oleg,
As far as I know, this fix can't be backported. I don't think it's possible to properly support GstMiniObject because it wasn't designed with introspection in mind (remember, the GStreamer 0.10 API is almost 7 years old now). I don't believe it's possible to fix this without breaking the 0.10 API. And this is just one of many issues that make it impossible to fully use GStreamer 0.10 from PyGI.
However, I imagine that GStreamer 1.0 will be made available through at least precise-backports. As it's parallel installable with GStreamer 0.10, it's quite safe to backport as it wont effect any existing 0.10 using applications. I think a case could be made for even backporting GStreamer 1.0 packages into Universe, but I don't know what the policy is there.
Anyway, I agree it's a bummer that Python + Gtk3 + GStreamer isn't usable in Precise. But g-i and PyGI are big transitions, and these things just take time.
If you want to start porting your app, there are GStreamer 1.0 packages in Quantal and there are packages for Precise in the GStreamer dev PPA (also in the Novacut stable PPA now):
https:/
Cheers!
Changed in pygobject: | |
status: | Confirmed → Expired |
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()