PDA

View Full Version : Efficient video display using OpenGL / comparing execution time



fruchtquark
5th October 2012, 12:17
For a Qt 4.8.2 / MSVC2010 application displaying several camera feeds (1 MP, 30 Hz) I started with a QGraphicsScene that has a QPixmapElement which is created from a QImage populated with pixel data from the camera interface. With the given data rate for a single video, a Core2Duo is at 40% load, a newer i5 (?) does it with 15 %.
I am not sure what part is causing the work, the complicated way to create the image, or the QGraphicsView rendering the scene. I would like to benchmark that, but I don't know how to do that.

Regardless of where the bottleneck is, aparently the way to go for video applications is OpenGL, because the image data is sent to the graphics card directly.
There seems to be a method to handle the rendering of a graphicsscene by OpenGL:

ui->graphicsView->setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
However, this does not reduce processor load, rather, it increases it. I have an Nvidia GeForce 8600GT that should support OpenGL, 32 bit Windows 7 and DirectX 11.
Another option would be to drop QGraphicsScene and do everything in OpenGL, but I have no clue yet how to do that.
Any hints appreciated.