- Build the first image with ffmpeg
Takes 8 hours on Pi Zero.
-
Build image called
streaming -
Run the streaming imagee:
docker ps -aq|xargs docker rm -f;
docker run --privileged -ti streaming <you_tube_secret_here>
| FROM resin/rpi-raspbian:jessie | |
| ENTRYPOINT [] | |
| RUN apt-get update -qy && apt-get -qy install \ | |
| build-essential git | |
| WORKDIR /root/ | |
| RUN git clone https://github.com/FFmpeg/FFmpeg.git | |
| workdir /root/FFmpeg | |
| RUN apt-get install -qy libomxil-bellagio-dev | |
| RUN ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree | |
| #RUN ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx-rpi --enable-nonfree | |
| RUN make | |
| RUN make install | |
| CMD ["/bin/bash"] |
| FROM alexellis2/ffmpeg-armv7 | |
| # or alexellis2/ffmpeg-armv6 | |
| RUN apt-get update && apt-get -qy install \ | |
| libraspberrypi-bin && \ | |
| rm -rf /var/lib/apt/lists/* | |
| WORKDIR /root/ | |
| COPY entry.sh . | |
| RUN chmod +x entry.sh | |
| ENTRYPOINT ["./entry.sh"] |
| #!/bin/bash | |
| echo Live-stream secret: $1 | |
| raspivid -o - -t 0 -w 1920 -h 1080 -vf -hf -fps 40 -b 8000000 -g 40 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i pipe:0 -c:v copy -c:a aac -ab 128k -g 40 -strict experimental -f flv -r 30 rtmp://a.rtmp.youtube.com/live2/$1 |