I created a class I called "VideoSurfaceAdapter" which inherits from a QAbstractVideoSurface which allows me access to the raw frames. See https://code.google.com/p/livepro/source/browse/trunk/gfxengine/QtVideoSource.cpp for the code.
Basically, in supportedPixelFormats() I return the formats I'll support, and then in present(...), I do the conversion using QImage - the code is all in the link above. I hope this helps - forgive me if I misunderstood your problem. On Tue, Sep 17, 2013 at 9:52 AM, Jason H <scorp...@yahoo.com> wrote: > 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.lo...@digia.com> > *To:* Jason H <scorp...@yahoo.com> > *Cc:* "evazq...@grm.uci.cu" <evazq...@grm.uci.cu>; " > interest@qt-project.org" <interest@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 > > > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > > -- Josiah Bryan 765-215-0511 josiahbr...@gmail.com
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest