Skip to content

accessing camera from multiple processes #72

@melippmann

Description

@melippmann

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DifficultThis is a hard problemHigh PriorityThis task is required for MVPbugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions