繁体   English   中英

高性能QImage输出显示

[英]High performance QImage output to display

我正在尝试将视频输出(帧序列)发送到任何qt可见小部件。 一开始我认为QLabel就足够了......但我错了。 转换为pixmap对于大型图像处理器来说过载:例如1080p。

还有其他方法吗? (不是QLabel?)

一帧代码示例:

QImage m_outputFrameImage(width, height, QImage::Format_RGB888);
memcpy(m_outputFrameImage.bits(), m_frameRGB->data[0], height * width * 3);
QPixmap pixmap = QPixmap::fromImage(m_outputFrameImage); // BAD, slow and high load
/* Bad too (Same code?)
    QPainter painter;
    painter.begin(&pixmap);
    painter.drawImage(0, 0, m_outputFrameImage);
    painter.end();
*/
labelVideo->setPixmap(pixmap);

是的,将帧渲染到QGLWidget并让视频卡处理它。 这就是Qt MultimediaKit,Phonon和其他人的做法。

前段时间我分享了一些代码,演示了如何完成这项任务: 通过OpenGL进行图像缩放(KeepAspectRatioByExpanding)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM