New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to open more than 2 webcams #139
Comments
Hi, Thank you for the report. Can you share more details?
Moreover, can you perform a small test to check whether Webcam Capture API is able to open both cameras, but not at once? Try open the first one, then close, and then try to open the second one. I'm asking you to do that since there are some webcam devices which default, the build-in driver, is not able to handle, and the effect you are showing above is exactly the same. However, if you are able to open both devices separately, it means that it should not be the case. |
thank you for you fast response |
i forgot to mention that all webcams are connected via USB |
Hi, Thank you for the details. To be honest, I never tested default driver with more than two webcams, but will try this in this week. Will have to borrow webcam devices from my friends since I do not have so many of them :) Theoretically the default driver (which use videoinput library by oftheo) should be able to handle up to 20 webcams at once - I will have to verify this. As the w/a you can try installing GStreamer and try to use dedicated driver. For more details please check webcam-capture-gstreamer-driver page. |
Hi , @sarxos , |
Hi, Is the problem exactly the same, or stack trace is different? Can you post it here? |
Hi java.lang.ExceptionInInitializerError |
Ah, I know this exception - it's caused by a bug I accidentally made in String.format(..), it was already fixed in 8373146 Can you try it again with this JAR? |
hi 0:00:10.738508000 300 07C1DF68 ERROR dshowvideosrc gstdshowvideosrc.cpp:589:gst_dshowvideosrc_change_state: Can't RUN the directshow capture graph (error=0x8007001f) |
Hi @ousmanou, That gives us the explanation of why default capture driver didn't work. Some background: all the Windows implementations which deals with web camera devices are build on top of DirectShow, which expose API to build capture graph which will fetch images from such device. The http://msdn.microsoft.com/en-us/library/windows/desktop/dd319335%28v=vs.85%29.aspx
I'm not familiar with neither low level DirectShow functions nor with winapi and thus cannot give you any answer on why this is happening. Are you connecting all the cameras to the USB hub, or you are using your build-in USB ports, and if this is the case, are you using USB3 as well? I googled a little bit and found that some people are encountering the same error when using multiple webcams, but there is no direct answer from Microsoft on why such error appears in case of multiple webcams. This is worth to read: |
thank very much for your wonderful help ; Just one question , will i get better result using another operating system ? |
Not sure... However, from my experience I found that the fastest and less error-prone webcam support implementation is available on Linux. If I can be hones - implementing properly working Windows implementation was a pain in the arse... Just take a short compare look on these two systems, and on what they give you: the Video For Linux library (libv4l) is open source, constantly improved, very fast, and from the other hand Windows DirectShow is... closed implementation, not maintained any more, to be replaced by Media Foundation in future, hard to code. |
@sarxos |
Hi, I was looking to reproduce this issue for some time, but I haven't had more than 2 webcam devices for tests. Lately I found some cheep ones on sale and bought 2 more. Today I tested this issue with 4 webcams total (using Ubuntu Linux) and was able to confirm that such issue exists, but it's caused by the USB and libv4l limitations, not the API itself. Test environment:
The outcome:
The error message from libv4l is:
NOTE! The error message is pretty misleading, but it means that there is not enough bandwidth on the USB controller to execute this operation. Unfortunately I don't know the solution. In the future I will try to expose more camera parameters to the API so user will be able to tune them up so bandwidth is not so heavily consumed. There is nothing I can do for now in regards to this ticket so I'm closing it. |
Just FYI, the newest webcam-captrure-driver-v4l4j (Linux only) should select the most appropriate (i.e. the most bandwidth-friendly) image format. Therefore, at least on Linux, opening more webcams at once should be technically possible. |
Dear Sarxos: |
@sarxos hi!
thank for your Webcam capture , but i am unable to open more than 2 webcams
i need some helps
i always got this exception
The text was updated successfully, but these errors were encountered: