Last active
July 6, 2022 19:05
-
-
Save RingoMar/d1e67e5f5c8643348a0a5ff7e67db544 to your computer and use it in GitHub Desktop.
Live stream direct to Twitch using Raspberry Pi & 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 | |
PRESET="ultrafast" # ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo | |
SOURCE="https://link.m3u8" | |
KEY="live_XXXXXX_XXXXXXXXXXXXXXXXXX" | |
ffmpeg \ | |
-re -i "$SOURCE" -vcodec libx264 -preset $PRESET -maxrate 3000k -b:v 2500k \ | |
-bufsize 600k -pix_fmt yuv420p -g 60 -c:a aac -b:a 160k -ac 2 \ | |
-ar 44100 -f flv -s 1280x720 "rtmp://live-lhr.twitch.tv/app/$KEY" | |
ffmpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_delay_max 10 -i "https://source.com/index.m3u8" -codec:a aac -c:v copy -f flv 'rtmp://' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment