ChicoState / ChicoState/open-source-security-camera

accessing camera from multiple processes

Open
#72 0 comments 0 reactions 0 assignees View on GitHub
bug Difficult help wanted High Priority
Dominant language
Python
Stars
10
Forks
5
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
The main motion detection app and web app can't both access the camera at the same time.

**To Reproduce**
Steps to reproduce the behavior:

1. Open 2 terminals
2. From terminal 1 do: ./manage.py runserver
3. From terminal 2 do: ./motiondetect.py
4. navigate to the homepage of the web app (may need to hit the settings page first if this is the first time you are running)
5. depending on which program accessed the camera first, (either motiondetect or home page of the web app) the other won't be able to access it.

**Expected behavior**
both programs should be able to take images as input

**Additional context**

- After digging around, this seems to be a common issue. In order to fix it, we should have a 3rd program that reads images from the camera (a producer thread) and turn the other programs into consumers (pulling from a queue or Redis)

- alternatively, we could pipe images from the main program (motiondetect.py) to the web app.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.