Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5 on Ubuntu 22.04 Logi C270 USB Camera Viewfinder Issues
Forum Updated to NodeBB v4.3 + New Features

Qt5 on Ubuntu 22.04 Logi C270 USB Camera Viewfinder Issues

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 682 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.
  • L Offline
    L Offline
    lcharris142857
    wrote on last edited by lcharris142857
    #1

    I'm having trouble getting my Qt5 code to show my Logi 22.04 USB Camera viewfinder on Ubuntu 22.04 OS Linux Workstation.
    Qt5 finds the camera, turns the camera on, but it never shows the viewfinder, and it returns the below error.

    Camera-related Qt5 code:
    QCamera *camera;
    QCameraViewfinder *viewfinder;
    QCameraImageCapture *imageCapture;
    const QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
    for (const QCameraInfo &cameraInfo : cameras) {
    if (cameraInfo.deviceName() == "/dev/video6")
    {
    camera = new QCamera(cameraInfo);
    qDebug() << cameraInfo.description();
    break;
    }
    }
    viewfinder = new QCameraViewfinder(ui->widget);
    imageCapture = new QCameraImageCapture(camera);
    camera->setViewfinder(viewfinder);
    camera->setCaptureMode(QCamera::CaptureStillImage);
    viewfinder->show();
    camera->start();

    Error:
    Camerabin error: "Internal error: could not render surface"
    Camerabin error: "Internal data stream error."

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Does dmesg tell you anything related to that ?
      Can GStreamer properly manage that device ?

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

      L 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Does dmesg tell you anything related to that ?
        Can GStreamer properly manage that device ?

        L Offline
        L Offline
        lcharris142857
        wrote on last edited by lcharris142857
        #3

        @SGaist What dmesg or gstreamer command should I run if my usb camera is on /dev/video4.
        I'm guessing I am missing a ubuntu 22.04 QT5 library or I have the wrong version of a library.
        My usb camera works with cheese and guvcview.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          dmesg does not require any parameters.

          For GStreamer, just start the camera and show its output.

          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
          • L Offline
            L Offline
            lcharris142857
            wrote on last edited by lcharris142857
            #5

            GL Streamer showed my camera's viewfinder just fine. (execution below).
            Cheese and Guvcview also show my camera's viewfinder just fine.

            Linux OS Version : ubuntu 22.04.3
            GL Streamer Version: GStreamer 1.20.1
            Qt Version: 5.15.3

            Command:
            gst-launch-1.0 v4l2src device=/dev/video4 ! videoconvert ! autovideosink

            Output:
            Setting pipeline to PAUSED ...
            Pipeline is live and does not need PREROLL ...
            Got context from element 'autovideosink0': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"(GstGLDisplayX11)\ gldisplayx11-0";
            Pipeline is PREROLLED ...
            Setting pipeline to PLAYING ...
            New clock: GstSystemClock
            Redistribute latency...

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Are you using the Qt version that comes with your system ?
              In any case, you can also create a custom GStreamer pipeline with QMediaPlayer.

              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

              • Login

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