Commit d24aa961 authored by Nicolas PERNOUD's avatar Nicolas PERNOUD
Browse files

Initial commit

parents
# Streaming box
A simple script to turn an headless raspberry pi 4 (with a **good** microphone) into a plug and play youtube streaming box.
## Setup
Set up the pi to boot in logged in (pi user) console mode with `sudo raspi-config`.
Copy the **start_stream.sh** script into `/home/pi` and make it executable with `chmod +x ./start_stream.sh`.
Put your youtube API key into the script.
Add `./start_stream.sh` at the end of `/home/pi/.bashrc`.
## Usage
Plug the microphone. Plug the Raspberry Pi. Enjoy.
## Debug
Debug : boot with a screen and keyboard, use CTRL+C to exit the running script.
#!/bin/sh
KEY="***PUT YOUR YOUTUBE API KEY HERE***"
sleep 30 # Allow time for the raspberry pi to boot
echo "STREAM BOX STARTED - Press [CTRL+C] to stop..."
while true; do
#Pipe to ffmpeg
#Audio stream
#Video stream (from pipe)
#Audio options
#Video options
#Push to youtube
raspivid -n -o - -t 0 -hf -fps 25 -b 6000000 | ffmpeg -re \
-thread_queue_size 8192 \
-f alsa -i plughw:1,0 \
-thread_queue_size 8192 \
-f h264 -i - -r 25 \
-ac 1 -acodec libmp3lame -ar 44100 -b:a 128k \
-vcodec copy \
-g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/$KEY
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment