Last active
September 17, 2019 19:40
-
-
Save woudsma/7f57a307bb4e841715297ed24ecbcaa2 to your computer and use it in GitHub Desktop.
static video to realtime live stream to twitch with ffmpeg - quick n dirty
This file contains hidden or 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
# Quick and dirty script for streaming a video file to Twitch (as if it were live) | |
# Requirements: ffmpeg (http://www.ffmpeg.org) | |
# Copy-paste the function and call it in your command line | |
# Or add the function to ~/.bash_profile, ~/.zshrc, ..etc. | |
# Usage: | |
# twitch STREAM_KEY FILEPATH | |
# Example: | |
# twitch live_122343457_TxVALrandomstuffA1ADt /Users/woudsma/Music/streams/recording.mp4 | |
twitch() { | |
echo "Usage: twitch STREAM_KEY FILEPATH" | |
STREAM_KEY="$1" | |
SERVER="live-ams" # twitch server in frankfurt, see http://bashtech.net/twitch/ingest.php for list | |
ffmpeg -re -i "$2" \ | |
-vcodec copy \ | |
-acodec libmp3lame -ar 44100 -threads 2 -b:a 128k -bufsize 2048k \ | |
-f flv "rtmp://$SERVER.twitch.tv/app/$STREAM_KEY" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment