Search code examples
c++ffmpeglibav

How to distinguish between identical cameras in Libav/ffmpeg?


I have two identical cameras connected and using Libav/FFmpeg. The option settings are:

format = "dshow"
input = "video=Videology USB-C Camera"

However, I am not able to distinguish between the two identical cameras. If I try to print out the list of devices, I get the following:

$> FFmpeg -list_devices true -f dshow -i dummy

[dshow @ 02597f60] DirectShow video devices
[dshow @ 02597f60]  "Integrated Camera"
[dshow @ 02597f60]  "Videology USB-C Camera"
    Last message repeated 1 times
[dshow @ 02597f60] DirectShow audio devices
[dshow @ 02597f60]  "Microphone (Realtek High Defini"

The cameras do appear as the same device, twice. The only thing I see so far, is the USB-port differs in the OS-hardware properties. Is it anyhow possible to distinguish between them?


Solution

  • You can use:

    video_device_number Set video device number for devices with same name (starts at 0, defaults to 0).

    audio_device_number Set audio device number for devices with same name (starts at 0, defaults to 0).

    Example:

    ffmpeg -f dshow -video_device_number 1 -i video="Camera"

    Source: FFmpeg Devices