Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # script for streaming to Twitch
- streaming() {
- INRES="1920x1080" # input resolution
- OUTRES="1280x720" # output resolution
- FPS="30" # target FPS
- GOP="60" # i-frame interval, should be double of FPS,
- GOPMIN="30" # min i-frame interval, should be equal to fps,
- THREADS="3" # max 6
- THREAD_Q_SIZE="512" # something to do with thread blocking -CaptainKraft
- CBR="1500k" # constant bitrate (should be between 1000k - 3000k)
- BUF="3000k" # I like double the CBR, not sure if this helps much -CaptainKraft
- QUALITY="ultrafast" # one of the many FFMPEG preset
- AUDIO_RATE="44100"
- STREAM_KEY="$1" # use the terminal command Streaming streamkeyhere to stream your video to twitch or justin
- SERVER="live-ord" # twitch server in frankfurt, see http://bashtech.net/twitch/ingest.php for list
- ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0+1920,0 -f alsa -i pulse -f flv -ac 2 -ar $AUDIO_RATE \
- -vcodec libx264 -g $GOP -keyint_min $GOPMIN -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p\
- -s $OUTRES -preset $QUALITY -tune film -acodec libmp3lame -threads $THREADS -strict normal \
- -bufsize $CBR "rtmp://$SERVER.twitch.tv/app/$STREAM_KEY"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement