Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.9.0, 5.9.1
-
None
-
Windows
Description
We have tested the YUV Format on QML VideoOutput with an QAbstractVideoSurface.The picture 'yuyv_source.png' is a screenshot of the source QVideoFrame and the 'yuyv_QVideoOutput.png' is a screenshot of the VideoOutput. There you can see a huge different in the quality of the image, where the QT rendering is pretty bad. In our application we need the YUV Rendering, because it is much faster an need les cpu performance, as the conversion from YUV in RGB on CPU. But with this quality the YUV rendering capability ist not useful.
// C++ QAbstractVideoSurface* m_videoSurface; m_surfaceFormat = QVideoSurfaceFormat(QSize(bmiHeader.biWidth, bmiHeader.biHeight), QVideoFrame::Format_YUYV, QAbstractVideoBuffer::NoHandle); m_surfaceFormat.setScanLineDirection(QVideoSurfaceFormat::TopToBottom); m_surfaceFormat.setYCbCrColorSpace(QVideoSurfaceFormat::YCbCr_xvYCC709); QAbstractVideoSurface* ANTCapCamDevice::videoSurface() const { return m_videoSurface; } void ANTCapCamDevice::setVideoSurface(QAbstractVideoSurface* surface) { if((m_videoSurface != surface) && (m_videoSurface) && (m_videoSurface->isActive())) { m_videoSurface->stop(); } m_videoSurface = surface; } void ANTCapCamDevice::onVideoFrameAvailable(QVideoFrame frame) { /** Variablen **/ /** Start **/ if(m_videoSurface != NULL) { m_videoSurface->present(frame); } // video.yuyv shown at http://rawpixels.net // video.yuyv is the source image (yuyv_source.png) QFile file; file.setFileName(QLatin1String("C:\\video.yuyv")); file.open(QIODevice::ReadWrite|QIODevice::Truncate); frame.map(QAbstractVideoBuffer::ReadOnly); file.write((char*)frame.bits(),frame.width()*frame.height()*2); frame.unmap(); } void ANTCapCamDevice::startPreview() { /** Variablen **/ /** Start **/ // Start surface putDebug << "Start VideoSurface" << m_videoSurface; putDebug << "VideoSurfaceFormat:" << m_surfaceFormat; if(m_videoSurface->isActive()) {m_videoSurface->stop();} if((m_videoSurface->start(m_surfaceFormat)) != true) { // Error } /** Ende **/ }
// QML // screenshot from VideoOutput is the image (yuyv_QVideoOutput.png) VideoOutput { id: videoOutput_livestream width: (resizingOfLive)?(parent.width):(sourceRect.width) height: (resizingOfLive)?(parent.height):(sourceRect.height) anchors.centerIn: parent visible: true fillMode: VideoOutput.PreserveAspectFit source = classHandle.camDeviceListModel.get(activeCameraIndex).videoOutput }
Attachments
For Gerrit Dashboard: QTBUG-62155 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
197065,14 | Improve quality of YUVY and UYVY rendering | 5.9 | qt/qtmultimedia | Status: MERGED | +2 | 0 |