convert QVideoFrame to QImage

前端 未结 4 1618
北海茫月
北海茫月 2021-01-12 16:06

I want to get every frames from a QMediaPlayer and convert it to QImage (or cv::Mat)

so I used videoFrameProbed

4条回答
  •  一向
    一向 (楼主)
    2021-01-12 16:31

    For anyone ending up here after finding that the qt private function "qt_imageFromVideoFrame" no longer exists in Qt5.15.0, you can now use the newly implemented method QImage QVideoFrame::image().

    QImage img = frame.image();
    

    I've tested this on Ubuntu and it works.

提交回复
热议问题