Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How best to construct a QVideoFrame
Forum Update on Monday, May 27th 2025

How best to construct a QVideoFrame

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Beacon11
    wrote on last edited by
    #1

    Hello all. I have a relatively simple application that receives an RTP video stream and displays it. For simple testing purposes, when I've received an image into my buffer, I create a QImage out of it and then simply using QLabel::setPixmap() in the GUI to display it. Obviously that's pretty slow.

    Now that I've got the video stuff working correctly, I'm ready to start optimizing this. I saw http://doc.qt.digia.com/4.7-snapshot/multimedia-videographicsitem.html and thought that looked perfect, but it's creating QVideoFrames out of QImages.

    My question is this: Since I initially have access to the image in buffer form, instead of first creating a QImage, would it be fastest to map a QVideoFrame to memory and simply use it as my image buffer? If yes, since QVideoFrames are explicitly shared, does that require creating a new QVideoFrame each time?

    I'm just looking for the fastest solution here. Thank you for any advice!

    1 Reply Last reply
    0
    • C Offline
      C Offline
      CrimsonGT
      wrote on last edited by
      #2

      Unfortunately I cannot much of much help on this subject as I am very new to Qt and have long since been away from C++, but I am trying to do exactly the same thing you are with an RTMP streams. If you don't mind, would you share what you have working at the moment? I have a byte stream from librtmp and am trying to figure out how to get the byte streams into a QVideoFrame format.

      Thanks!

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Beacon11
        wrote on last edited by
        #3

        CrimsonGT, no problem, what I have is pretty simple: Use "this":http://qt-project.org/doc/qt-4.8/qimage.html#QImage-7 constructor to turn your byte stream into a QImage, and from there you can get to the QVideoFrame with with "this":http://doc-snapshot.qt-project.org/4.8/qvideoframe.html#QVideoFrame-4 . If you need any more guidance you'll probably want to start your own thread :) .

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved