Docker Community Forums

Share and learn in the Docker community.

Video stream in-out via docker

I am new to Docker and want to do some video processing inside a docker container , now I want to stream a video from host to docker container where it will be processed and then it will again be sent out in any form and received by HOST.
I have started with GSTREAMER with UDP which will send my video to container but I cant figure it out.

Any help would be appreciated.

First, you need to give an interpreter for executing the script.

Second, you can’t run vlc as root.

Third, you can’t provide a file as argument and expect vlc to open it from inside the container, when the file is on the host. You need to mount it first.

Fourth, you need to quote $sout variable, otherwise it will begin with # and bash will ignore it as an argument and won’t pass it to vlc.

Fifth, if you want the stream to be available outside, you will need to expose the port.

Make the following changes:


FROM ubuntu

RUN apt-get update
&& apt-get install -y vlc

RUN useradd -m vlcuser

COPY /tmp/
COPY counter.mp4 /tmp/
ENTRYPOINT ["/tmp/"]


Two facultativ parameters : -f and -i <URL_Output>

SCRIPTPATH=( cd (dirname $0) ; pwd -P );
while getopts “f:i:” OPTNAME
case $OPTNAME in
f) name=$OPTARG;;
i) sdp=$OPTARG;;
su vlcuser -c “vlc -vvv $name --sout ‘$sout’”
And run the container as:

docker run -v $PWD/namevideo.mp4:/tmp/namevideo.mp4 -p 8554:8554 test -f /tmp/namevideo.mp4