linux qt yuv,c – 如何使用Qt中的RGBA32数据将带有YUV数据...
我找到了一個內(nèi)置于Qt5的解決方案,但是不受Qt的支持.
以下是如何進行的:
>將QT = multimedia-private放入qmake .pro文件中
>將#include“private / qvideoframe_p.h”放入代碼中以使該功能可用.
>您現(xiàn)在可以訪問具有以下簽名的函數(shù):QImage qt_imageFromVideoFrame(const QVideoFrame& frame);
>使用該函數(shù)將QVideoFrame轉(zhuǎn)換為臨時QImage,然后從該圖像創(chuàng)建輸出QVideoFrame.
這是我的示例用法:
QVideoFrame convertFormat(const QVideoFrame &inputframe, QVideoFrame::PixelFormat outputFormat)
{
inputframe->map(QAbstractVideoBuffer::ReadOnly);
QImage tempImage=qt_imageFromVideoFrame(inputframe);
inputframe->unmap();
QVideoFrame outputFrame=QVideoFrame(tempImage);
return outputFrame;
}
同樣,從標(biāo)頭復(fù)制的警告內(nèi)容如下:
06001
這在我的項目中無關(guān)緊要,因為它是個人玩具產(chǎn)品.如果它變得嚴重我將只追蹤該功能的實現(xiàn)并將其復(fù)制到我的項目或其他東西.
總結(jié)
以上是生活随笔為你收集整理的linux qt yuv,c – 如何使用Qt中的RGBA32数据将带有YUV数据...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mybatis insert插入成功返回
- 下一篇: jenkins使用哪个版本号_Linux