Skip to content

Instantly share code, notes, and snippets.

@FLY-chan
Created May 7, 2014 16:03
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 FLY-chan/2379a35023a424dd2538 to your computer and use it in GitHub Desktop.
Save FLY-chan/2379a35023a424dd2538 to your computer and use it in GitHub Desktop.
#Livestream script for FFMpeg/FFServer
FPS=24 # Stream FPS.
GOP=48 # GOP Should be double of FPS.
THREADS=4 # How many threads.
DEADLINE=realtime # Speed preset, realtime is fastest.
FRAMELAG=16 # How many frames to seek ahead (max 25)
QMAX=52 # More = less quality.
QMIN=10 # Less = more quality.
VBITRATE=1M # Target Bitrate.
BITRATE=3000k # Bitrate.
AUDIBR=48k # Audio Bitrate.
SERVER=cyberlife.io:8090/feed.ffm # Server stream endpoint.
LOGLEVEL=verbose # Logging verbosity level.
for f in $@; do ffmpeg -re -i $f\
-g $GOP -loglevel $LOGLEVEL\
-c:v libvpx -threads $THREADS -b:v $BITRATE -vb $VBITRATE -bufsize $BITRATE\
-qmax $QMAX -qmin $QMIN -deadline $DEADLINE -lag-in-frames $FRAMELAG\
-c:a libvorbis -b:a $AUDIBR\
-filter_complex [0:s:0]overlay\
"http://$SERVER"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment