Results 1 to 2 of 2

Thread: Map a QVideoFrame

  1. #1
    Join Date
    Apr 2015
    Posts
    7
    Thanks
    3
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Question Map a QVideoFrame

    Hello Qt experts !

    I am having some trouble using an external program (GStreamer1.0) running along with Qt (on windows 7).
    I manage to get some frames out of a pipeline using the QImage type like this :
    Qt Code:
    1. const QImage frame(bufferInfo.data,width,height,myQImageFrameFormat);
    To copy to clipboard, switch view to plain text mode 

    Now since Qt 5.5 is release, I would like to do the same but by mapping received frame into a QVideoFrame (since it seems to be the class dedicated to it).
    However I'm having some trouble. The documentation says that normally I should be albe to map the "frame buffer" into memory in order to write into it using bits();.

    I did a few tries but it seems that the function map:
    Qt Code:
    1. myVideoFrame->map(QAbstractVideoBuffer::ReadWrite);
    To copy to clipboard, switch view to plain text mode 
    always give a "false" meaning (I guess) that the mapping into memory has failed.
    I really dont know why I have this since the only actions I did on this video frame is
    • creating the frame
    • Adding metadata
    • setting the field type


    I don't know if I am too early using this class since Qt5.5 just came out but I did not read anything about being cautious using QVideoFrame and I'm not finding any example on the web.
    Thanks in advance for your help !
    Last edited by maxilase; 16th July 2015 at 13:49.

  2. #2
    Join Date
    Apr 2015
    Posts
    7
    Thanks
    3
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Windows

    Post Re: Map a QVideoFrame

    Following up my problem I was finally able to map my QVideoFrame by using a local variable instead of a member one.

    Now I am getting another problem, since I (normally) have my frame filled up, how do I display it ? One of my problem being that the QVideoFrame::PixelFormat seems not to exist for QImage or QPixmap (QVideoFrame::Format_RGB32).

    I was hoping that I could use some kind of QVideoWidget or QMediaPlayerto display my frames but I dont see obvious way to do it...

Similar Threads

  1. Replies: 10
    Last Post: 25th November 2013, 23:57

Tags for this Thread

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.