-
-
Save marcsello/b120f6aa1495315baa7723806c7e45f7 to your computer and use it in GitHub Desktop.
Stream video to youtube via ffmpeg
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
| #! /bin/bash | |
| # Youtube streaming stuff, original by: https://gist.github.com/olasd/9841772 | |
| # Configuration of stream; pootis bitrate here, resolution will be the video's | |
| VBR="2500k" # Bitrate of ze stream | |
| FPS="24" # FPS of ze stream | |
| QUAL="medium" # Quality preset (ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo) | |
| YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL of ze Youtube, (default is ze main) | |
| KEY="...." # Your streaming key | |
| ffmpeg \ | |
| -i "$1" -deinterlace \ | |
| -vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \ | |
| -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \ | |
| -f flv "$YOUTUBE_URL/$KEY" | |
| echo "Streaming ended" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment