Detect whether camera is present?
Thomas Wagner from Germany  [51 posts]
9 year

is there a way to automatically detect whether any camera is present or not?

Depending on the outcome, I'd like to either use live stream or turn to images from files.

Should work without knowing which type of camera is used, if I know one special type is used, I could probably use the module of that type.

Steven Gentner from United States  [1446 posts] 9 year

There is a CAMERA_NAME and CAMERA_PATH variable that gets set when a camera is active. You might be able to use that for detection of a camera. Otherwise, you may want to constrain the problem a little more since checking for IP based cameras would take forever.

Is there a specific use case that you are thinking about using this camera discovery for?

Thomas Wagner from Germany  [51 posts] 9 year


I have added an improved version of the sudoku solver here. When detecting a live camera, I want to switch away from loading from file.

I will probably not put tooo much furthewr work into this program, but there are some things which may be interesting for you:
* when adding or removing images files to the image directory during the run of the program, strange things happen to the results of the sudoku. I'd expet RR to either include or ignore changes of the directory during execution, but it seems do do neither nor.
* Adding or removing a camera during the run does not yield stable results at all.
* Even if the camera is present at the beginning of execution, changing from one sudoku to the next with the camera does also not seem to update in a correct way.

Maybe you can learn a little more from playing with this.

Thanks again,


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index