Search code examples
google-chromechromium

Run Chromium with fake webcam and real micro


I can run the Google Chrome with the fake webcam using this command:

$ google-chrome-stable --use-fake-device-for-media-stream --use-file-for-fake-video-capture=video.mjpeg

This works fine, but I can only use fake audio sources using this configuration. How to run Chromium/Google Chrome with fake video stream and real audio stream?

Also you can use any Python modules you want.


Solution

  • With --use-fake-device-for-media-stream it is not possible, Chrome will always use fake audio:

    if (base::CommandLine::ForCurrentProcess()->HasSwitch(
            switches::kUseFakeDeviceForMediaStream)) {
      params_.set_format(media::AudioParameters::AUDIO_FAKE);
    }
    

    Use a virtual webcam and your real microphone instead. A quick selection from searching: