
當嘗試使用 VLC 打開我的 USB 攝影機時,我得到
Capture failed:
The device you selected cannot be used, because its type is not supported.
Capture failed:
VLC cannot open ANY capture device. Check the error log for details.
Capture failed:
The device you selected cannot be used, because its type is not supported.
Capture failed:
VLC cannot open ANY capture device. Check the error log for details.
但奇怪的是zoom打開卻沒有問題。
我正在運行最新的 vlc 版本 3.0.12
預設情況下,日誌記錄顯然是禁用的,我透過以下方式啟用了它
Tools -> Preferences -> Select "ALL" -> Advanced -> Logging
檢查日誌沒有發現任何有用的信息,除了“directshow”無法打開此相機
dshow error: can't use device: USB CAMERA, unsupported device type
我提高了日誌等級進行調試,但這並沒有透露更多信息
dshow 調試:dshow-vdev:USB 攝影機 dshow 調試:找到裝置:USB 攝影機
我嘗試查找 USB ID,但不確定是否正確,但可能是
USB\VID_0AC8&PID_3420\5&22ac01e1&0&3
這是一個帶有 C 連接埠的 USB 或 HDMI 輸出攝像頭,它用作顯微鏡攝像頭,但我將它用作具有可互換鏡頭的普通網路攝影機。
謝謝 !
答案1
這幾乎肯定是因為解析度太高、錯誤,或者 USB 總線不支援吞吐量(特別是如果您使用的是 USB 2 集線器)。
你需要運行v4l2-ctl --all
這個應該顯示你現在在 vlc 中工作的所有設備,然後運行v4l2-ctl --list-devices
這個應該向你顯示類似這樣的設備列表,
Integrated Camera: Integrated C (usbid):
/dev/video2
/dev/video3
/dev/video4
/dev/video5
/dev/media0
/dev/media1
UC70: UC70 (usbid):
/dev/video6
/dev/video7
/dev/media2
找到您想要的視訊*裝置。在這個例子中,UC70 是我的網路攝影機,它公開了兩個裝置 /dev/video6 和 /dev/video7。
然後找到他們支援的格式,如下所示
v4l2-ctl -d /dev/video6 --list-formats-ext
v4l2-ctl -d /dev/video7 --list-formats-ext
對我來說,只有video6
任何支援的格式,它返回這個(注意你想要視訊串流而不是 MJPG),
[1]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 1920x1080
Interval: Discrete 0.500s (2.000 fps)
Size: Discrete 3840x2160
Interval: Discrete 1.000s (1.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.133s (7.500 fps)
Interval: Discrete 0.200s (5.000 fps)
Interval: Discrete 0.500s (2.000 fps)
Size: Discrete 2048x1536
Interval: Discrete 0.500s (2.000 fps)
Size: Discrete 2560x1440
Interval: Discrete 0.500s (2.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.133s (7.500 fps)
Interval: Discrete 0.200s (5.000 fps)
Interval: Discrete 0.500s (2.000 fps)
Interval: Discrete 1.000s (1.000 fps)
現在,在做任何事情之前,我可以透過運行來交叉檢查 vlc 預設值vlc v4l2:///dev/video6 -vv
,我看到了這一點,
[00007f1b64001170] v4l2 demux debug: best discrete frame size: 3840x2160
[00007f1b5c000c30] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f1b5c000c30] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007f1b5c000c30] main art finder debug: no art finder modules matched
[0000563402032240] qt interface debug: IM: Setting an input
[00007f1b64001170] v4l2 demux warning: cannot reset cropping limits: Inappropriate ioctl for device
[00007f1b64001170] v4l2 demux debug: 16588800 bytes maximum for complete image
[00007f1b64001170] v4l2 demux debug: Interlacing setting: progressive
[00007f1b64001170] v4l2 demux debug: color primaries: 8
[00007f1b64001170] v4l2 demux debug: transfer function: 1
[00007f1b64001170] v4l2 demux debug: YCbCr encoding: 1
[00007f1b64001170] v4l2 demux debug: quantization: 0
[00007f1b64001170] v4l2 demux debug: added new video ES YUY2 3840x2160 (3840x2160)
[00007f1b64001170] v4l2 demux debug: frame rate: 1/1
[00007f1b64001170] v4l2 demux debug: aspect ratio: 1/1
[00007f1b70000c90] main input debug: selecting program id=0
libv4l2: error turning on stream: Input/output error
[00007f1b64001170] v4l2 demux error: cannot start streaming: Input/output error
[00007f1b64001170] v4l2 demux debug: opening device '/dev/video6'
[00007f1b64001170] v4l2 demux debug: device UC70: UC70 using driver uvcvideo (version 6.1.27) on usb-0000:52:00.0-2.2.2.2
[00007f1b64001170] v4l2 demux debug: with capabilities 0x05200001 (overall 0x85A00001)
[00007f1b64001170] v4l2 demux error: not a radio tuner device
讓我們嘗試使用 3840x2160 以外的其他分辨率
vlc v4l2:///dev/video6 -vv --v4l2-width=640 --v4l2-height=470
工作正常。
太棒了; VLC 可以開啟最高解析度的串流、縮放,而其他用戶端則不能。