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. Two webcams and their audio
Qt 6.11 is out! See what's new in the release blog

Two webcams and their audio

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

    I have two Logitech BRIO webcams and can readily switch between them by selecting their unique deviceId. Here is the QML code for context

    import QtQuick 2.9
    import QtMultimedia 5.12
    
    Rectangle {
            property int camIndex: 0        
            property string dutId: ""
    
    	onDutIdChanged: {
    		var camId = camera.deviceId
    		if(dutId == camId) {
    			console.log("*** match for: " + camId)
    		}
    	}
    	
    	Camera {
    		id: camera
    		captureMode: Camera.CaptureStillImage
    		deviceId: QtMultimedia.availableCameras[camIndex].deviceId
    
    		videoRecorder {
    			resolution: "1280x720"
    			frameRate: 30
    		}
    	}
    }
    

    However, the audio source for each webcam must be found independently. I can enumerate the audio devices using QAudioDeviceInfo, but they identify only as
    Logitech BRIO
    Logitech BRIO

    Question 1: How to know which audio device belongs to each webcam microphone?

    Question 2: How to switch webcam and audio together?

    The QAudioRecorder class has helpful availableInputs() and setActiveInput(), methods, but the QCamera and QMediaRecorder classes do not. I suspect that I need to find a QMediaService from which I can get a QAudioInputSelectorControl. However I have failed to make it work.

    Any suggestions?

    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 OS are you running on ?

      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
      • Z Offline
        Z Offline
        zing0001
        wrote on last edited by
        #3

        MacOS, but I like cross-platform solutions.

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

          Each platform returns different informations hence the need to know on which one you are working.

          Can you check what you have in the Sound part of the System Settings ?

          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