如何区分相同的摄像机在Libav / ffmpeg? [英] how to distinguish between identical cameras in Libav/ffmpeg?

查看:600
本文介绍了如何区分相同的摄像机在Libav / ffmpeg?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个相同的相机连接到我的电脑。相机是视频21K355usb(如果有人需要这个信息)。我使用Libav或ffmpeg(测试与两个libs)抓住相机。我的选项在我的c + +程序是简单的:

  format =dshow
input =video = Videology USB- C相机

但我无法区分它们。如果我尝试打印设备列表,我得到以下:

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

[dshow @ 02597f60] DirectShow视频设备
[dshow @ 02597f60]集成摄像头
[dshow @ 02597f60] USB-C相机
最后留言重复1次
[dshow @ 02597f60] DirectShow音频设备
[dshow @ 02597f60]麦克风(Realtek High Defini)

你可以看到,我的视频摄像机显示为相同的设备,两次,我唯一看到的东西,是usb-端口

解决方案

您可以使用:



video_device_number
为设备设置相同名称的视频设备号码(从0开始,默认为0)。



audio_device_number 为同名的设备设置音频设备号
(从0开始,默认为0)。


示例:



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



资料来源: FFmpeg设备


i have two identical cameras connected to my pc. the cameras are videology 21K355usb (if someone need this information). i'm using Libav or ffmpeg (tested with both libs) to grab the cameras. my options in my c++ program are simply:

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

but i cannot distinguish between them. 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"

as you can see, my videology camera appears as the same device, twice. the only thing i see so far, is the usb-port differse in the os-hardware properties. is it anyhow possible to destiguish between them?

解决方案

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

这篇关于如何区分相同的摄像机在Libav / ffmpeg?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆