Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Nicolas PERNOUD
streamingbox
Commits
d24aa961
Commit
d24aa961
authored
Feb 10, 2020
by
Nicolas PERNOUD
Browse files
Initial commit
parents
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
0 → 100644
View file @
d24aa961
# 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.
start_stream.sh
0 → 100644
View file @
d24aa961
#!/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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment