如何区分Libav/ffmpeg中相同的相机?

How to distinguish between identical cameras in Libav/ffmpeg?

我连接并使用了两个相同的摄像头Libav/FFmpeg。选项设置为:

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

但是,我无法区分两个相同的相机。如果我尝试打印出设备列表,我会得到以下信息:

$> 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"

相机确实显示为同一设备,两次。到目前为止,我唯一看到的是 USB 端口在 OS 硬件属性方面有所不同。无论如何都可以区分它们吗?

您可以使用:

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).

示例:

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

来源:FFmpeg Devices