Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Dan Farmer <dfarmernv-Re5JQEeQqe8AvxtiuMwx3w <at> public.gmane.org>
Subject: Multiple Cameras with OpenCV 2.2 (Python)
Newsgroups: gmane.comp.lib.opencv.user
Date: Tuesday 1st March 2011 18:38:36 UTC (over 5 years ago)
Hello,

I've been trying to get multiple cameras working with Python using the
following test script in Fedora Linux 14 (32bit). There are three
cameras attached via USB (though I'm just trying to get two going for
now). Any help would be appreciated.


#! /usr/bin/env python
import cv

cap1 = cv.CaptureFromCAM(1)
#cap2 =  None
cap2 = cv.CaptureFromCAM(0)

while True:
    img1 = cv.QueryFrame(cap1)
    cv.ShowImage("Camera 1", img1)
    if cap2:
        img2 = cv.QueryFrame(cap2)
        cv.ShowImage("Camera 2", img2)
    if cv.waitKey(60) > 0:
        break


However the results I get are one camera working, the "Camera 2"
window is blank and in the console I get

VIDIOC_QBUF: Invalid argument
VIDIOC_QBUF: Invalid argument
VIDIOC_QBUF: Invalid argument
VIDIOC_QBUF: Invalid argument
VIDIOC_QBUF: Invalid argument

Thanks!

-Dan

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT
data 
generated by your applications, servers and devices whether physical,
virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev
 
CD: 3ms