Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97079

Setting camera format leads to error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.2.1
    • 6.2.0
    • Multimedia
    • None
    • Linux/X11

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            piotr Piotr Srebrny (Inactive)
            igor.mironchik Igor Mironchik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes