Skip to content

Instantly share code, notes, and snippets.

@antonva
Created April 25, 2014 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonva/11304006 to your computer and use it in GitHub Desktop.
Save antonva/11304006 to your computer and use it in GitHub Desktop.
ffmstream() {
filename=$1
gop=48 #GOP Should be double of FPS, but since we determine that on runtime, we'll just assume it's 24
threads=4
crf=22 # Ideally this should be 18, 23 is the default
preset=veryfast # x264 preset
tune=film
bitrate=1500k # Our CBR
audibr=128k # Audio Bitrate
server=jerusalem.systems/feed
loglevel="verbose"
ffmpeg -re -loglevel $loglevel -i $filename\
-g $gop\
-codec:v libx264 -threads $threads -crf $crf -preset $preset -tune $tune -b:v $bitrate -maxrate $bitrate -bufsize $bitrate\
-codec:a libfaac -ab $audibr\
-f flv "rtmp://$server/"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment