'enabling docker image camera disables the 2nd camera used by "motion" on raspberry

i'm using octoprint docker image (Docker version 19.03.15, build 99e3ed8919) on a rapsberry 3 with raspbian stretch. i am also using motion and so i have 2 usb cameras connected. the cameras for both are configured and working fine, but they cannot work together for some reason: in order for the camera of motion to work i have to stop the docker image of octoprint, and when i start the docker octoprint - its camera is working but motion's stops (becomes non available). i am using the following to start the docker image:

docker run -d -v octoprint:/octoprint --device /dev/ttyUSB0:/dev/ttyUSB0 --device /dev/video0:/dev/video0 -e MJPG_STREAMER_INPUT="-y -n -r 1366x768 -f 5" -e ENABLE_MJPG_STREAMER=true -p 80:80 --restart unless-stopped --name octoprint octoprint/octoprint

my camera for motion is configured to /dev/video2

any idea how to solve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source