[gst-devel] Troubles with gstreamer, pygtk and ubuntu karmic
Ron McOuat
rmcouat at smartt.com
Mon Nov 16 20:37:48 CET 2009
I had the same problem. The tutorial version of the code for handling
the assignment of the "prepare-xwindow-id" message is incomplete.
Looking in the example code under gst-python reveals a few more steps. I
changed the tutorial code to look like the following and it worked.
def on_sync_message(self, bus, message):
if message.structure is None:
return
if message.structure.get_name() == "prepare-xwindow-id":
# Assign the viewport
gtk.gdk.threads_enter()
gtk.gdk.display_get_default().sync()
imagesink = message.src
imagesink.set_property("force-aspect-ratio", True)
imagesink.set_xwindow_id(self.movie_window.window.xid)
gtk.gdk.threads_leave()
The code form the examples directory in gst-python is not the same as
above but I pulled in the thread sync code to make it work.
Here is the code (commented out) from the examples
# Example code from
#
http://cgit.freedesktop.org/gstreamer/gst-python/tree/examples/maemogst.py
#
# all this is needed to sync with the X server before giving the
# x id to the sink
#gtk.gdk.threads_enter()
#gtk.gdk.display_get_default().sync()
#self.video_widget.set_sink(message.src)
#message.src.set_property("force-aspect-ratio", True)
#gtk.gdk.threads_leave()
I have also had trouble with the NVidia X server not displaying the
video with the proper colour map. If I move a recorded file off a cam to
another machine it displays the correct colour map but I am sure that is
a separate issue.
Hope that helps,
Ron
Nicolas Bertrand wrote:
> Hi,
> I use gstreamer and pygtk for webcam acquisition. Since I upgraded to
> ubuntu karmic 9.10, I was facing some application freeze/crash.
>
> Most of the time the application freeze and webcam application does
> not start.
>
> For illusrate my problem I use the example from pygst tutorial ( simple
> webcam acquisition and display) :
> http://pygstdocs.berlios.de/pygst-tutorial/webcam-viewer.html
>
> This program operates normaly on ubuntu dapper drake and ubuntu jaunty
> jackalope. I execute the program at least 5 times and webcam
> acquisition, is always OK.
>
> If I execute the same script on ubuntu karmic, sometimes its ok and
> sometimes not. Most of the the time the webcam acquisition fails.
>
> What I noticed under karmic :
> If I use videotestsrc instead of v4l2src, I still having the problem
> --> so its seems not due to webcam acquisition.
> When display is not 'forced' to a Drawing area, i.e. the
> acquisition starts in another window in place of application window, the
> script never crash and webcam acquisition is good. For doin that doin I
> don't connect the signal 'sync-message::element'
>
> Do anyone has facing this problem or have an idea for how to
> understand/debug this problem.
>
> I post this message on gstreamer and pygtk, because I do not know where
> the problem or bad usage come from ?
>
> Thanks in advance for help.
>
> Nico
> https://launchpad.net/~nico-inattendu
>
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> 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