├── Dockerfile ├── LICENSE ├── README.md └── streaming ├── Dockerfile └── entry.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM resin/rpi-raspbian:jessie 2 | ENTRYPOINT [] 3 | 4 | RUN apt-get update -qy && apt-get -qy install \ 5 | build-essential git 6 | WORKDIR /root/ 7 | RUN git clone https://github.com/FFmpeg/FFmpeg.git 8 | workdir /root/FFmpeg 9 | RUN apt-get install -qy libomxil-bellagio-dev 10 | 11 | RUN ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-nonfree 12 | RUN make 13 | RUN make install 14 | 15 | CMD ["/bin/bash"] 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alex Ellis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # raspberrypi-youtube-streaming 2 | Stream straight to YouTube from your Raspberry Pi with Docker. 3 | -------------------------------------------------------------------------------- /streaming/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ffmpeg:17-5-2017 2 | 3 | RUN apt-get update && apt-get -qy install \ 4 | libraspberrypi-bin && \ 5 | rm -rf /var/lib/apt/lists/* 6 | 7 | WORKDIR /root/ 8 | COPY entry.sh . 9 | RUN chmod +x entry.sh 10 | 11 | ENTRYPOINT ["./entry.sh"] 12 | -------------------------------------------------------------------------------- /streaming/entry.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo Live-stream secret: $1 4 | 5 | raspivid -o - -t 0 -w 1920 -h 1080 -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 6 | 7 | --------------------------------------------------------------------------------