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



  • 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


  • Lifetime Qt Champion

    Hi and welcome to devnet,

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



  • 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


  • Lifetime Qt Champion

    Do you also have the GStreamer plugins installed ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.