jnohlgard / python-v4l2capture

Python extension to capture video with video4linux2 (fork of https://launchpad.net/python-v4l2-capture)
133 stars 83 forks source link

some question about two camera use #20

Closed cgpeter96 closed 5 years ago

cgpeter96 commented 5 years ago

my code like this:

while True:
    # top_cam and bot_cam is camera device
    select.select([top_cam,bot_cam],(),())
    #select.select([top_cam],(),())
    #select.select([bot_cam],(),())
    data1= top_cam.read_and_queue()
    data2 =  bot_cam.read_and_queue()

it will appear error :

libv4l2: error dequeuing buf: Resource temporarily unavailable
Traceback (most recent call last):
  File "cam_test2.py", line 105, in <module>
    data2 =  bot_cam.read_and_queue()
BlockingIOError: [Errno 11] Resource temporarily unavailable

but when i comment select.select([top_cam,bot_cam],(),()) ,and replace in select.select([top_cam],(),());select.select([bot_cam],(),()).

The biggest problem is when i use the latter,it will appear some image is None.

so I want use select.select([top_cam,bot_cam],(),()) ,what should I do?

thanks!

I am not good at English