Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Error connecting camera via OpenCV
Forum Updated to NodeBB v4.3 + New Features

Error connecting camera via OpenCV

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
6 Posts 3 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mtalha2621
    wrote on 22 Feb 2024, 08:13 last edited by
    #1

    Hi, I am developing a Qt Application on a customized yocto-build OS. The Qt Application is expected to stream live camera feed on to the HDMI connected LCD. Here are some further details of the device and error.

    OS: Linux imx8mminvsom 5.4.47-1.00-inventron-som+gd8c10bbcd #1 SMP PREEMPT Thu May 11 12:56:07 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

    I am reading the image using:
    ```

    VideoCapture cap(0);
    Mat frame = imread("/opt/DSv2/bin/Lab.png");
    
    //    Check if the camera opened successfully
    if (!cap.isOpened()) {
            qDebug() << "Error: Could not open camera";
            cap.release();
    }
    

    ERROR:

    [ WARN:0] global /usr/src/debug/opencv/4.4.0.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (1760) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
    [ WARN:0] global /usr/src/debug/opencv/4.4.0.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
    [ WARN:0] global /usr/src/debug/opencv/4.4.0.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
    Error: Could not open camera
    

    Any help regarding solving this issue would be appreciated.

    V 1 Reply Last reply 22 Feb 2024, 09:00
    0
    • M mtalha2621
      22 Feb 2024, 08:13

      Hi, I am developing a Qt Application on a customized yocto-build OS. The Qt Application is expected to stream live camera feed on to the HDMI connected LCD. Here are some further details of the device and error.

      OS: Linux imx8mminvsom 5.4.47-1.00-inventron-som+gd8c10bbcd #1 SMP PREEMPT Thu May 11 12:56:07 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

      I am reading the image using:
      ```

      VideoCapture cap(0);
      Mat frame = imread("/opt/DSv2/bin/Lab.png");
      
      //    Check if the camera opened successfully
      if (!cap.isOpened()) {
              qDebug() << "Error: Could not open camera";
              cap.release();
      }
      

      ERROR:

      [ WARN:0] global /usr/src/debug/opencv/4.4.0.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (1760) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module v4l2src0 reported: Internal data stream error.
      [ WARN:0] global /usr/src/debug/opencv/4.4.0.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (888) open OpenCV | GStreamer warning: unable to start pipeline
      [ WARN:0] global /usr/src/debug/opencv/4.4.0.imx-r0/git/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
      Error: Could not open camera
      

      Any help regarding solving this issue would be appreciated.

      V Offline
      V Offline
      Vijaykarthikeyan
      wrote on 22 Feb 2024, 09:00 last edited by
      #2

      @mtalha2621 check the webcam whether it is accessible

      M 1 Reply Last reply 22 Feb 2024, 10:35
      0
      • V Vijaykarthikeyan
        22 Feb 2024, 09:00

        @mtalha2621 check the webcam whether it is accessible

        M Offline
        M Offline
        mtalha2621
        wrote on 22 Feb 2024, 10:35 last edited by
        #3

        @Vijaykarthikeyan it is not a webcam. It is a MIPI CSI Camera ov5645_mipi

        I have verified the connection of camera via
        timeout -s INT 10s gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1920,height=1080,framerate=30/1' ! waylandsink

        It is working. But I am getting error in capturing via OpenCV in Qt Application

        S 1 Reply Last reply 22 Feb 2024, 20:06
        0
        • M mtalha2621
          22 Feb 2024, 10:35

          @Vijaykarthikeyan it is not a webcam. It is a MIPI CSI Camera ov5645_mipi

          I have verified the connection of camera via
          timeout -s INT 10s gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1920,height=1080,framerate=30/1' ! waylandsink

          It is working. But I am getting error in capturing via OpenCV in Qt Application

          S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 22 Feb 2024, 20:06 last edited by
          #4

          @mtalha2621 you can tell OpenCV to use GStreamer (if the support has been built).

          See this thread on the OpenCV forum.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply 26 Feb 2024, 05:35
          0
          • S SGaist
            22 Feb 2024, 20:06

            @mtalha2621 you can tell OpenCV to use GStreamer (if the support has been built).

            See this thread on the OpenCV forum.

            M Offline
            M Offline
            mtalha2621
            wrote on 26 Feb 2024, 05:35 last edited by
            #5

            @SGaist OpenCV is using GStreamer. As you can see in my question, OpenCV is returning GStreamer error. I have tried multiple pipelines but same result has been found.

            S 1 Reply Last reply 26 Feb 2024, 20:45
            0
            • M mtalha2621
              26 Feb 2024, 05:35

              @SGaist OpenCV is using GStreamer. As you can see in my question, OpenCV is returning GStreamer error. I have tried multiple pipelines but same result has been found.

              S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 26 Feb 2024, 20:45 last edited by
              #6

              @mtalha2621 My bad, I misread the error messages. What I had in mind when answering is for you to use your custom pipeline with OpenCV.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              1/6

              22 Feb 2024, 08:13

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved