1

カメラを開く方法: ターミナルで ($ プロンプトの後のテキスト = 入力するコマンド): _________________

$ ls /dev/video*
/dev/video0  /dev/video1
$ vlc v4l2:///dev/video0
VLC media player 2.0.8 Twoflower (revision 2.0.8a-0-g68cf50b)
[0x9f2d908] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.

VLC がカメラ出力の再生を開始します。

別の新しい端末 (太字 = 私が入力するコマンド):

$ vlc v4l2:///dev/video1
VLC media player 2.0.8 Twoflower (revision 2.0.8a-0-g68cf50b)
[0x9b24908] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0xb0500960] v4l2 demux error: VIDIOC_STREAMON failed
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
[0xb0501188] v4l2 access error: cannot set input 0: Device or resource busy
[0xb0501188] v4l2 access error: cannot set input 0: Device or resource busy
[0xb5300618] main input error: open of `v4l2:///dev/video1' failed

ビデオは再生されず、エラー メッセージのみが表示されます。

主な目的: opencv (c++) で 2 台のカメラを同時に開きたい... opencv で同様のエラーが発生したため、VLC Player を使用して問題をデバッグしています。c++ opencv を使用して 2 台のカメラを同時に開いたときのエラー (コードはhttps://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/starter_video.cpp?rev=4705に似ています)

e557822@e557822-T740:~/Desktop/Camera/starter_video2$ ls /dev/video*
/dev/video0  /dev/video1  /dev/video2
e557822@e557822-T740:~/Desktop/Camera/starter_video2$ ./starter_video2 0 1
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
press space to save a picture. q or esc to quit
init done 
opengl support available 
libv4l2: error turning on stream: No space left on device
VIDIOC_STREAMON: No space left on device

UPDATE 7/24 : この Ubuntu 12.04 (32 ビット) は、VMware Fusion で実行されるゲスト OS です。ここでのホスト OS は、Mac Pro コンピュータ ハードウェア上で動作する OSX 10.9.4 です。

$ lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
    |__ Port 1: Dev 2, If 0, Class=HID, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=hub, Driver=hub/7p, 12M
        |__ Port 1: Dev 4, If 0, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M
        |__ Port 1: Dev 4, If 1, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/6p, 480M
    |__ Port 1: Dev 6, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
    |__ Port 1: Dev 6, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
    |__ Port 2: Dev 7, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
    |__ Port 2: Dev 7, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
$ 
4

1 に答える 1

2

これは USB 帯域幅の問題であり、VLC の問題ではありません。

VIDIOC_STREAMON: No space left on deviceUSB 帯域がいっぱいになったときに表示されるメッセージです。

最近のほとんどの USB カメラは、高速で高密度の画像出力を行います。USB2 は、理論上 60 メガバイト/秒である 480Mbps に制限されています。実際には、あらゆる種類のオーバーヘッドがその約半分を使用し、取得できる最大値は 30 メガバイト/秒です。これは、カメラが 30fps で 1 メガバイトの画像を送信できることを意味します。

できることは、複数の USB バスを備えたマザーボードを入手することだけです。すべての小型コンピュータには 1 つしかない傾向があります。ハイエンドのゲーミング マザーボードには、2..3 個の USB2.0 バスがあります。Linuxで見ることができます:

$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M
    |__ Port 4: Dev 2, If 0, Class=scard, Driver=usbfs, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/8p, 480M
        |__ Port 5: Dev 3, If 0, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M
        |__ Port 5: Dev 3, If 1, Class='bInterfaceClass 0xe0 not yet handled', Driver=btusb, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci_hcd/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=hub, Driver=hub/6p, 480M
        |__ Port 3: Dev 3, If 0, Class=vend., Driver=rts5139, 480M
        |__ Port 5: Dev 4, If 0, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
        |__ Port 5: Dev 4, If 1, Class='bInterfaceClass 0x0e not yet handled', Driver=uvcvideo, 480M
$ 

ほとんどの場合、両方のカメラが同じバスに接続されています。

他のオプションは、FPS 速度または解像度を下げることです。しかし、USB 帯域幅の 80% を予約しているカメラを見たことがあるので、これが常に役立つとは限りません。

于 2014-07-24T04:56:51.183 に答える