title: run vlc in a Docker image to send a video stream via rtsp protocol
body: <p>I am using Docker for a project. The goal is to play a video in VLC and send the data stream via the RTSP protocol, so that the other machines(user) can see the video on live in their machines.
  the video, the Dockerfile and the bash file are in the same folder. here is a bash file (simulate_video_stream.sh) I use:</p>
  
  <pre><code># Two facultativ parameters : -f &lt;nameOfTheVideoFile&gt; and -i &lt;URL_Output&gt;
  SCRIPTPATH=$( cd $(dirname $0) ; pwd -P );
  name=$SCRIPTPATH"/counter.mp4";
  sdp="rtsp://:8554/flux";
  while getopts "f:i:" OPTNAME
  do
     case $OPTNAME in
        f) name=$OPTARG;;
        i) sdp=$OPTARG;;
     esac
  done
  sout="#transcode{vb=0,scale=0,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{sdp="$sdp"}";
  vlc -vvv $name --sout $sout
  </code></pre>
  
  <p>And here is the Dockerfile:</p>
  
  <pre><code>FROM ubuntu
  
  RUN apt-get update \
  &amp;&amp; apt-get install -y vlc
  
  COPY simulate_video_stream.sh /tmp/
  COPY counter.mp4 /tmp/
  ENTRYPOINT ["/tmp/simulate_video_stream.sh"]
  </code></pre>
  
  <p>The build is a success by <strong>"sudo docker build -t test ."</strong> I am hoping to use it with the two parameters defined in the bash file, like <strong>"docker run test -f namevideo.mp4 -i rtsp://:8554/test"</strong>
  But it returns "write pipe: bad file descriptor"
  What should I do? Thanks</p>