I receive QVideoFrames
from webcam, and they contain image data in YUV format (QVideoFrame::Format_YUV420P
). How can I convert one
I've found a YUV --> RGB conversion solution in the linked comment,
So Implementing the supportedPixelFormats function like the following example does the magic of converting even YUV based formats (in my case, it converted a Format_YUV420P format) into the Format_RGB24 format:
QListMyVideoSurface::
supportedPixelFormats(QAbstractVideoBuffer::HandleType handleType) const
{
Q_UNUSED(handleType);
return QList()
<< QVideoFrame::Format_RGB24
;
}
Tell me if it worked for you.