2014-07-24 3 views
1

어떻게 내가 카메라를 엽니 다 터미널에서합니다 ($ 프롬프트 후 텍스트를 = I 입력 것을 명령) : _________________열린 2 USB 카메라를 동시에 VLC 플레이어 우분투 12.04

$ 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는 카메라 출력을 재생 시작 . (I 입력 BOLD = 명령) 다른 단말기에 새로운

:

아니오 비디오가 재생되지
$ 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++) ... opencv ..와 유사한 오류가 발생했습니다. 그래서 VLC Player를 사용하여 문제를 디버깅하고 있습니다. 우분투 12.04 (32 비트)는 VM웨어 퓨전에서 실행되는 게스트 OS이다 오류 동시에 ++을 OpenCV를 C를 이용하여 두 개의 카메라를 개방

[email protected]:~/Desktop/Camera/starter_video2$ ls /dev/video* 
/dev/video0 /dev/video1 /dev/video2 
[email protected]:~/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 (코드 https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/starter_video.cpp?rev=4705와 유사하다). 여기서 호스트 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 
$ 

답변

2

이것은 VLC 하나가 아니라 USB 대역폭 문제입니다.

VIDIOC_STREAMON: No space left on device은 USB 대역폭이 가득 차면 제공되는 메시지입니다.

대부분의 최신 USB 카메라는 고속, 고밀도 이미지 출력을 수행합니다. USB2는 이론상 60 메가 바이트/초의 480Mbps로 제한됩니다. 실제로 모든 종류의 오버 헤드는 약 절반을 사용하며 30 메가 바이트/s는 최대로 얻을 수 있습니다. 즉, 카메라는 1 메가 바이트의 이미지를 30fps로 보낼 수 있습니다.

당신이 할 수있는 것은 여러 개의 USB 버스가있는 마더 보드를 얻는 것입니다. 모든 소형 컴퓨터에는 단 하나만있는 경향이 있습니다. 하이 엔드 게임 마더 보드에는 2..3 USB2.0 버스가 있습니다. 당신은 리눅스에서 그것을 볼 수 있습니다 :

$ 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 %를 예약하는 카메라를 보았 기 때문에 항상 도움이되지는 않습니다.

+0

위의 메인 포스트 하단의 "UPDATE 7/24 :"를 참조하십시오. lsusb -t – ironhyde

+0

이 업데이트에는 하나의 USB2.0 버스 만 있습니다 (480Mbps 버스 찾기 2.0입니다.) –

+0

VMware 융합에서 버스를 하나 더 추가하려면 어떻게합니까? – ironhyde