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

VideoSink frame to image does not work on android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.6, 6.7.1, 6.8.0 FF
    • 6.7.0
    • Multimedia
    • Android 11
    • Android
    • 1f568e593 (dev), 703331817 (6.7), 2e6fd4010 (tqtc/lts-6.5)
    • 2024wk14FOQtforAndroid

    Description

      I have a QML Module that decodes QR codes. I am using QtMultimedia for desktop and Android.

      I am using a video sink for inspecting every frame from the camera like

      QObject::connect(videoSink,&QVideoSink::videoFrameChanged,this,[=](const QVideoFrame & Vframe)
                           {
      
                               if(m_camera&&m_camera->isActive()&&Vframe.isValid()){
                                   auto picture=Vframe.toImage();
                                   WasmImageProvider::img=picture;
                                   setid();
                                   if(m_state)
                                   {
                                       auto var = std::thread(&QRImageDecoder::decodePicture, this,picture);
                                       var.detach();
                                   }
                               }
                           });
      

      In Android, the camera preview is not shown, shows a black screen, and the qr can not be decoded.

      It seems that `auto picture=Vframe.toImage();` return a black QImage. I have tried mapping the frame, setting RHS of the videosink to nullptr. However, I am not able to see the image from the camera on android.
      The videosink and the `videoFrameChanged` signal work well on Linux.

      The repo contains an example using the camera inside QtQrDec folder.

      To build the example just set the CMake option BUILD_EXAMPLES=ON.
      Then one can deploy the `qrcam` target to the Android device.

      Attachments

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

        Activity

          People

            bartlomiejmoskal Bartlomiej Moskal
            mesrine Eduardo Gonzalez
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes