Skip to content

Instantly share code, notes, and snippets.

@tristanstraub
Created January 5, 2016 11:02
Show Gist options
  • Save tristanstraub/ac5d5c264f671fe52664 to your computer and use it in GitHub Desktop.
Save tristanstraub/ac5d5c264f671fe52664 to your computer and use it in GitHub Desktop.
# INRES="1366x768" # input resolution
# OUTRES="1366x768" # output resolution
INRES="2560x1440" # input resolution
OUTRES="2560x1440" # output resolution
FPS="15" # target FPS
GOP="30" # i-frame interval, should be double of FPS,
GOPMIN="15" # min i-frame interval, should be equal to fps,
THREADS="2" # max 6
CBR="500k" # constant bitrate (should be between 1000k - 3000k)
QUALITY="veryfast" # one of the many FFMPEG preset
AUDIO_RATE="44100"
STREAM_KEY="macromancer?t=<mystreamingkey>" # your streaming key goes here
#to hide logs use= -loglevel quiet
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0 -f flv \
-vcodec libx264 -keyint_min 3 -b:v $CBR -minrate $CBR -maxrate $CBR -pix_fmt yuv420p \
-s $OUTRES -preset $QUALITY -acodec mp3 -threads $THREADS \
-bufsize $CBR "rtmp://eumedia1.livecoding.tv:1935/livecodingtv/$STREAM_KEY"
#-f alsa -i hw:0 -ac 2 -ar $AUDIO_RATE \
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment