Access camera inside docker container

I’m not sure that the flag volume (-v) is the best practice to do so.

According to the github of jfrazelle, docker engineer who wrote many Dockerfile and docker run for many graphical app such as chromium, skype, spotify, and so on, the flag and argument you should use is --device /dev/video0.

For quick test(tested on ubuntu), below code should give supported frame resolution of cameras:-

docker run --rm -it --entrypoint /bin/bash --device /dev/video0 jrottenberg/ffmpeg
ffmpeg -f video4linux2 -list_formats all -i /dev/video0

Leave a Comment