Created
May 16, 2022 09:42
-
-
Save nilsmagnus/06a96c945c9376b43a22c09c107d3e81 to your computer and use it in GitHub Desktop.
Stream to twitch with libcamera-vid and ffmpeg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STREAM_KEY=<insert your twitch stream key> | |
## you might want to use a different twitch-server, see https://stream.twitch.tv/ingests/ | |
while true | |
do | |
libcamera-vid -o - --brightness 0.1 -t 0 -g 30 --width 640 --height 480 | ffmpeg -re -f h264 -i pipe:0 -vcodec copy -strict experimental -f flv rtmp://osl.contribute.live-video.net/app/$STREAM_KEY | |
# pause a bit if things fail before restart | |
sleep 60 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment