views:

293

answers:

2

I have an mjpeg stream from a web-cam and would like to display it in an application written in python using pygtk. The stream is a string of bytes from the driver. What widget would be best for displaying this and would I need to do some intermediate conversion before putting it in the widget? Should I write my own widget to do this?

+1  A: 

GTK+ does not contain a native widget capable of decoding and rendering video.

You should probably look into GStreamer, which is a streaming-media toolkit built on the same GObject framework as GTK+.

It has the GstXvImageSink that is capable of rendering video using X11, and you should be able to configure it to render on top of a GTK+ widget.

unwind
A: 

This example helped me getting started with gstreamer, it shows how one grabbs the webcam stream and displays it in an widget.

http://pygstdocs.berlios.de/pygst-tutorial/webcam-viewer.html

Linus Unnebäck