Results 1 to 5 of 5

Thread: show images as live video with Qt

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default show images as live video with Qt

    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?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: show images as live video with Qt

    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 ?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: show images as live video with Qt

    Yes, you can convert images to OpenGL textures and show them on a plain rectangle using OpenGL.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: show images as live video with Qt

    Quote Originally Posted by aamer4yu View Post
    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()

  5. #5
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    691
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: show images as live video with Qt

    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
    Franco Amato

Similar Threads

  1. Live video streaming
    By khacminh in forum Qt Programming
    Replies: 2
    Last Post: 8th September 2013, 04:36
  2. live video capture
    By saman_artorious in forum Qt Programming
    Replies: 2
    Last Post: 9th July 2012, 09:59
  3. Live Video Inside QGLWidget
    By igorosberg in forum Qt Programming
    Replies: 0
    Last Post: 2nd June 2011, 14:10
  4. Live stream for Phonon video widget
    By Leolander in forum Qt Programming
    Replies: 0
    Last Post: 1st March 2010, 06:05
  5. Cross platform live video capture & display with Qt 4
    By AlbertGoodwill in forum Qt Programming
    Replies: 1
    Last Post: 24th October 2007, 20:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.