PDA

View Full Version : show images as live video with Qt



saman_artorious
14th September 2013, 13:16
I receive 25 images per second from network. I need to show them with a Qt program. To do this, at the beginning I tried using a label and updating the background image of this label. This unexpectedly took much CPU consumption, around 40%.
To solve this problem I used a Qt media player example to show images. This is fine, However, QMediaPlayer can only read images directly from QNetworkConfiguration and not manually.
Next, I thought of using mplayer or vlc to redirect the fifo to read from socket. However, this method is not suitable as I want to have button in my program. with vlc or alike, this cannot be done.

Do you think there is a way to accomplish what I want to show 25 images per second with less than 10% CPU consumption and having button widget in my program application?

aamer4yu
14th September 2013, 13:28
Are you trying label->setPixmap() ? Or drawing the image itself in paintEvent ??

Also what is the format of the image you recieve and conversion costs for converting to QImage or QPixmap ?

wysota
14th September 2013, 13:29
Yes, you can convert images to OpenGL textures and show them on a plain rectangle using OpenGL.

saman_artorious
14th September 2013, 13:49
Are you trying label->setPixmap() ? Or drawing the image itself in paintEvent ??

Also what is the format of the image you recieve and conversion costs for converting to QImage or QPixmap ?

I am using label->setPixmap()

franco.amato
14th September 2013, 14:39
Hi give a look at this project using Qt for gui and OpenCV for image processing.
It uses multithreading: https://code.google.com/p/qt-opencv-multithreaded/

Regards