Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.2.0
-
None
Description
If to use QVideoSink with QCamera and during initialization set camera's format any from available through cameraDevice().videoFormats(), then will be error like:
linking filtered camera to decoder failed camerasrc identity2 "video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480"
But if not set any format to camera, then video output will be seen with some default settings.
In the attachment just look at frames.cpp.
void Frames::initCam() { m_cam = new QCamera( this ); const auto settings = m_cam->cameraDevice().videoFormats(); m_cam->setFocusMode( QCamera::FocusModeAuto ); //m_cam->setCameraFormat( settings.at( 0 ) ); m_capture.setCamera( m_cam ); m_capture.setVideoSink( this ); m_cam->start(); }
Just comment/uncomment
m_cam->setCameraFormat( settings.at( 0 ) );
with any available index.