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

Decoding camera format MotionJPEG to NV12 is failed.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.4.2
    • Image formats
    • None
    • Environment: Mac mini, MacOS M1 64bit, Monterey 12.3.1

      USB port: USB 3.0

      Camera format: MotionJPEG
    • macOS

    Description

      Hi, 

      Environment: Mac mini, MacOS M1 64bit, Monterey 12.3.1

      USB port: USB 3.0

      Camera format: MotionJPEG

      Description:

      My camera format is MotionJPEG, and my camera can live play, but  I found decoding camera format MotionJPEG to NV12 is sometimes failed. Please refer the attached files. 

      //********************

      C++ code: 

      void CPreviewPage::startVideoStreaming(void)
      {    
          QString str_id;
          QString str_vid;
          QString str_pid;

          const QList<QCameraDevice> cameras = QMediaDevices::videoInputs();
          for (const QCameraDevice &camera_device : cameras)
         

      {         // example id = "0x2600000a16809b0" or "0x100000a1680970"         //qDebug() << "camera_device.id = " << camera_device.id();         str_id = camera_device.id().right(8);         str_vid = str_id.mid(0,4);         str_pid = str_id.right(4);         qDebug() << "id = " << str_id;         qDebug() << "vid = 0x" << str_vid;         qDebug() << "pid = 0x" << str_pid;         if(str_vid != "a168")             continue;         captureSession = new QMediaCaptureSession(this);         pCamera = new QCamera(camera_device);         captureSession->setCamera(pCamera);         pGraphyScene = new QGraphicsScene(0,0,640,480);         //pGraphyView = new QGraphicsView(this);         pGraphyView->setScene(pGraphyScene);         pGraphyVideoItem = new QGraphicsVideoItem;         pGraphyVideoItem->setSize(QSizeF(640,480));         pGraphyVideoItem->setPos(0,0);         pGraphyScene->addItem(pGraphyVideoItem);         captureSession->setVideoOutput(pGraphyVideoItem);         pImageCapture = new QImageCapture((QObject*)pCamera);         captureSession->setImageCapture(pImageCapture);         //QObject::connect(pImageCapture, SIGNAL(imageAvailable(int, const QVideoFrame&)), this, SLOT(onCaptureVideoFrame(int, const  QVideoFrame&)));         QObject::connect(pImageCapture, SIGNAL(imageCaptured(int, const QImage&)), this, SLOT(onCaptureImage(int, const  QImage&)));         pCamera->start(); // live play.         QString title = camera_device.description() + " 0x" + QString::number(myDeviceDetectionData.devicePid, 16);         setWindowTitle(title);         break;     }

      }

       

      Attachments

        1. 38-NG-1.jpg
          47 kB
          Wunian LEE
        2. 55-NG-1.jpg
          47 kB
          Wunian LEE
        3. 81-NG-1.jpg
          48 kB
          Wunian LEE
        4. 89-NG-1.jpg
          48 kB
          Wunian LEE

        Issue Links

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

          Activity

            People

              vgt Eirik Aavitsland
              wunian Wunian LEE
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes