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. QCameraInfo::availableCameras() doesn not show list f webcames
Forum Update on Monday, May 27th 2025

QCameraInfo::availableCameras() doesn not show list f webcames

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.6k Views
  • 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.
  • nimaaghliN Offline
    nimaaghliN Offline
    nimaaghli
    wrote on last edited by
    #1

    I want to list device names or device ids of web cams connected over usb to my ubuntu i tried this code but its not showing anything and its always empty

    
    QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
    foreach (const QCameraInfo &cameraInfo, cameras)
        qDebug() << cameraInfo.deviceName();
    

    can anyone help me how to make it work ? I have Ubuntu 12.04 and Qt5.5 and tried 3 different web cams non of them was detected

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

      Hi and welcome to devnet,

      What version of GStreamer do you have installed on your system ?

      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
      1
      • nimaaghliN Offline
        nimaaghliN Offline
        nimaaghli
        wrote on last edited by
        #3

        Hi,
        Thanks For your answer.

        Runing gstreamer-properties in command line gives me this :

        (gstreamer-properties:3473): Gtk-WARNING **: Unknown property: GtkDialog.has-separator
        (gstreamer-properties:3473): Gtk-WARNING **: Unknown property: GtkDialog.has-separator
        gstreamer-properties-Message: Skipping unavailable plugin 'artsdsink'
        gstreamer-properties-Message: Skipping unavailable plugin 'esdsink'
        gstreamer-properties-Message: Skipping unavailable plugin 'sunaudiosink'
        gstreamer-properties-Message: Skipping unavailable plugin 'glimagesink'
        gstreamer-properties-Message: Skipping unavailable plugin 'v4lmjpegsrc'
        gstreamer-properties-Message: Skipping unavailable plugin 'qcamsrc'
        gstreamer-properties-Message: Skipping unavailable plugin 'v4lsrc'
        gstreamer-properties-Message: Skipping unavailable plugin 'esdmon'
        gstreamer-properties-Message: Skipping unavailable plugin 'sunaudiosrc'

        I have gstreamer-0.10

        When the GUI of gstream comes up i can see my USB webcam in list of devices and the only plugin to select is v4l2 when pressing test button i get the stream but very low framerate.
        And

            QList<QCameraInfo> cameras = QCameraInfo::availableCameras();
        
            foreach (const QCameraInfo &cameraInfo, cameras)
                qDebug() << cameraInfo.deviceName()
        

        Returns nothing

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

          Do you also have the GStreamer plugins installed ?

          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