I am trying to access the webcam from the docker container but I am getting this error . Can someone please help me with this ?
I committed a container from an image available from the dockerhub (spmallick/opencv-docker )which has openCV and python
docker run -it --device=/dev/video0:/dev/video0 -v /tmp/.X11-unix:/tmp/.X11-unix -v ${HOME}/.Xauthority:/home/.Xauthority -e DISPLAY=$DISPLAY -p 5000:5000 -p 8888:8888 -it finaltest1 /bin/bash
ERROR:
(python3:107): GStreamer-CRITICAL **: gst_element_get_state: assertion ‘GST_IS_ELEMENT (element)’ failed
No protocol specified
QXcbConnection: Could not connect to display :0
Aborted (core dumped)
Is it possible to access the webcam from a container ?