How to display a videostream in the PyQt GUI by a efficient way
David Boddie
david at boddie.org.uk
Sat Sep 29 13:06:06 EDT 2007
On Sat Sep 29 05:12:25 CEST 2007, kivilaya wrote:
> As required, I need to get a videostream from a camera, and process
> every frame to add some information on it, and then display the frame
> in a PyQt GUI.
> But I don't know how to display the videostream in the PyQt GUI by a
> efficient way.
>
> Currently, I do these like this:
> 1. Get the videostream by the videocapture module (a useful module
> written by Markus Gritsch) in the format of PIL images;
This sounds interesting. I wasn't aware of that module.
> 2. Process every PIL image and add the information;
> 3. Convert every PIL image to QPixmap and display it using
> QLabel.setPixmap.
This could be quite inefficient, though I think there's some support for
Qt's image classes in PIL these days.
> I think it is a very inefficient way, but I don't known how to display
> the videostream in other ways, so I need your help, Thanks!
>
> PS:I do it with Windows XP, Python 2.5.1, PyQt4.3.0
If you're using a commercially-licensed Qt library, you'll have access to
the ActiveQt classes that can be used to embed ActiveX controls:
http://doc.trolltech.com/4.3/activeqt.html
Otherwise, you might find this recent thread on qt-interest to be of
interest:
http://lists.trolltech.com/qt-interest/2007-09/msg00806.html
I also tried to document ways to do this on the PyQt/PyKDE Wiki:
http://www.diotavelli.net/PyQtWiki/Multimedia_Resources
David
More information about the Python-list
mailing list