<div dir="auto">Another way to do this is using `--device /dev/video0`, which gives the container access to less of your host device than `--privileged`.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020, 03:40 Craig Carey <<a href="mailto:cynitec@gmail.com" target="_blank" rel="noreferrer">cynitec@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>You need to mount your video device, something like:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>docker run ... --privileged -v /dev/video0:/dev/video0 ...<br></div></blockquote><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020 at 10:20 AM Andrés Meseguer Valenzuela <<a href="mailto:anmeva1@etsid.upv.es" rel="noreferrer noreferrer" target="_blank">anmeva1@etsid.upv.es</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi, I am trying to use gstreamer via docker.<br>
My purpose is that my container installs GStreamer and then, it runs a <br>
gstreamer pipeline such as displaying<br>
my webcam for example.<br>
<br>
I have writen this dockerfile:<br>
<br>
FROM ubuntu:20.10<br>
<br>
RUN apt-get update && \<br>
apt-get -y install sudo<br>
<br>
RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser <br>
docker sudo<br>
<br>
CMD /bin/bash<br>
<br>
RUN sudo -s apt-get update<br>
RUN apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base <br>
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad <br>
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools <br>
gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 <br>
gstreamer1.0-qt5 gstreamer1.0-pulseaudio -y<br>
<br>
ENTRYPOINT gst-launch-1.0 v4l2src device=/dev/video0 ! <br>
'video/x-raw,width=640,height=480,framerate=30/1' ! videoconvert ! <br>
ximagesink<br>
<br>
USER docker<br>
<br>
It builds, but once I run the image with flags (--net=host -e DISPLAY <br>
-v $HOME/.Xauthority:/root/.Xauthority )<br>
it returns an error:<br>
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot <br>
identify device '/dev/video0'.<br>
<br>
I know that this is a problem of my dockerfile because this GStreamer <br>
pipeline works in local.<br>
Hence, I would like to know how to solve this.<br>
Thanks for your valuable time.<br>
Regards,<br>
Andrés.<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" rel="noreferrer noreferrer" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" rel="noreferrer noreferrer" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div>