Last active
August 29, 2015 14:27
-
-
Save dominiccooney/de0a3226e57f21ae7634 to your computer and use it in GitHub Desktop.
Try livestreaming Ubuntu desktop to YouTube using avconv
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 | |
# Adapted from http://danielj.se/2012/09/09/how-to-live-stream-your-ubuntu-desktop/ | |
INRES="2560x1440" # input resolution | |
OUTRES="1920x1080" | |
OFFSET="0,0" | |
FPS="15" # target FPS | |
QUAL="fast" # one of the many FFMPEG preset | |
URL="rtmp://a.rtmp.youtube.com/live2/${STREAM_KEY:?You need to set STREAM_KEY.}" | |
avconv -f x11grab -s "$INRES" -r "$FPS" -g $(expr $FPS / 4 + 1) \ | |
-i :0.0+$OFFSET -ab 0k \ | |
-f alsa -ac 2 -i pulse -vcodec libx264 -crf 30 -preset "$QUAL" -s "1920x1080" \ | |
-b 4500k -vol 0 -acodec libmp3lame -ar 44100 -threads 0 \ | |
-f flv "$URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment