gstreamer via dockerfile

Andrés Meseguer Valenzuela anmeva1 at etsid.upv.es
Thu Dec 3 10:20:25 UTC 2020


Hi, I am trying to use gstreamer via docker.
My purpose is that my container installs GStreamer and then, it runs a  
gstreamer pipeline such as displaying
my webcam for example.

I have writen this dockerfile:

FROM ubuntu:20.10

RUN apt-get update && \
       apt-get -y install sudo

RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser  
docker sudo

CMD /bin/bash

RUN sudo -s apt-get update
RUN apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base  
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad  
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools  
gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3  
gstreamer1.0-qt5 gstreamer1.0-pulseaudio -y

ENTRYPOINT gst-launch-1.0 v4l2src device=/dev/video0 !  
'video/x-raw,width=640,height=480,framerate=30/1' ! videoconvert !  
ximagesink

USER docker

It builds, but once I run the image with flags (--net=host -e DISPLAY  
-v $HOME/.Xauthority:/root/.Xauthority )
it returns an error:
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot  
identify device '/dev/video0'.

I know that this is a problem of my dockerfile because this GStreamer  
pipeline works in local.
Hence, I would like to know how to solve this.
Thanks for your valuable time.
Regards,
Andrés.






More information about the gstreamer-devel mailing list