Advertisement
Guest User

Untitled

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