Ask Your Question
0

VIDIOC_STREAMON Error!! Capture two webcam simultaneously.

asked 2014-03-12 03:18:37 -0600

SpiderGears gravatar image

updated 2014-03-12 05:33:15 -0600

Hey!! I am trying to work Minoru cam with opencv. I intend to generte disparity maps with the camera capture. I get the following error... As per the design of Minoru both the cams connect to same USB port.

HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP

VIDIOC_STREAMON: No space left on device

Here is output of bandwidth allocation when using one cam with guvcview application

sudo cat /sys/kernel/debug/usb/devices | grep "B: "

B: Alloc= 0/800 us ( 0%), #Int= 0, #Iso= 0

B: Alloc=251/800 us (31%), #Int= 4, #Iso= 5

okay.... Working with guvcview and this cat command i fig out i need work with lower frame rate like 15 fps to support two cams on single bus.

Unfortunately opencv is not able to set properties on my camera....

Any other way to set camera properties for capture??

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2014-11-05 04:19:47 -0600

tyggerjai gravatar image

Sorry, I should have tried first. This works for me:

VideoCapture capright(1);
capright.set(CV_CAP_PROP_FPS,15);
VideoCapture capleft(2);
capleft.set(CV_CAP_PROP_FPS,15);

with openCV2.4 in c++

Good luck!

edit flag offensive delete link more
0

answered 2014-11-05 04:15:17 -0600

tyggerjai gravatar image

updated 2014-11-05 04:16:56 -0600

I am about to try grab(), according to the documentation: "The primary use of the function is in multi-camera environments, especially when the cameras do not have hardware synchronization. That is, you call VideoCapture::grab() for each camera and after that call the slower method VideoCapture::retrieve() to decode and get frame from each camera. This way the overhead on demosaicing or motion jpeg decompression etc. is eliminated and the retrieved frames from different cameras will be closer in time.

Also, when a connected camera is multi-head (for example, a stereo camera or a Kinect device), the correct way of retrieving data from it is to call VideoCapture::grab first and then call VideoCapture::retrieve() one or more times with different values of the channel parameter. See https://github.com/Itseez/opencv/tree/master/samples/cpp/openni_capture.cpp"

from here: http://docs.opencv.org/modules/highgui/doc/reading_and_writing_images_and_video.html

I'll let you know!

Edit: Or perhaps this: https://stackoverflow.com/questions/7039575/how-to-set-camera-fps-in-opencv-cv-cap-prop-fps-is-a-fake

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-03-12 03:18:37 -0600

Seen: 2,551 times

Last updated: Nov 05 '14