[Interest] About usb cameras
Jason H
scorp1us at yahoo.com
Tue Sep 17 15:52:09 CEST 2013
Thanks, but I am still not clear.
If I subclass QAbstractVideoSurface (video probe is out - I need it on Windows) How do I get it into a QImage/Pixmap?
I am guessing that I would set the pixel format for it to be the same as for QImage? According to the that logic and the docs, there are a few formats that will work:
Format_ARGB32, Format_ARGB32_Premultiplied, Format_RGB32, Format_RGB555, Format_ARGB8565_Premultiplied
But will Qt do the conversion (if so how? lines of code please!). Do I tell the video source to give me a format? Does that format have to be supported by the device?
I don't mind updating the screen, as I will be generating an overlay. and pushing that to the screen.
Thanks!
________________________________
From: Lopes Yoann <Yoann.Lopes at digia.com>
To: Jason H <scorp1us at yahoo.com>
Cc: "evazquez at grm.uci.cu" <evazquez at grm.uci.cu>; "interest at qt-project.org" <interest at qt-project.org>
Sent: Tuesday, September 17, 2013 7:18 AM
Subject: Re: [Interest] About usb cameras
On Sep 16, 2013, at 5:46 PM, Jason H wrote:
Can someone tell me how to grab a frame and what is needed to be done to get to the point where I can do image processing easily?
With the C++ API you can use QVideoProbe (http://qt-project.org/doc/qt-5.0/qtmultimedia/qvideoprobe.html). Though, with a camera source, it will currently work only on Linux with the GStreamer backend. The frames can be in any format, including an OpenGL texture, and you'll have to to convert it to a QImage yourself if it's what you want to do.
You can also subclass QAbstractVideoSurface (http://qt-project.org/doc/qt-5.0/qtmultimedia/qabstractvideosurface.html). It will work on all platforms and you will be able to specify the format of the received frames with supportedPixelFormats(). You will also have to take care of showing the frames on screen youself...
Yoann Lopes
Senior Software Engineer - Digia, Qt
Visit us on: http://qt.digia.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130917/7ad2540b/attachment.html>
More information about the Interest
mailing list