Johann Savalle

@yasha.solutions

Product designer and full stack developper living in france
< Back to all articles

RTMP restream with ffmpeg

February 21, 2019

here is how you can restream a source video from one RTMP to Facebook live

ffmpeg -i "rtmp://yourInputStream.stream" \
-r 30 \
-ar 44100 \
 -s 1280x720 \
 -c:a libfdk_aac -b:a 90k \
 -movflags +faststart \
 -preset veryfast -crf 28 \
 -tune zerolatency \
 -profile:v baseline \
-maxrate 1000k \
-vcodec libx264 \
-bufsize 10000k \
-g 60 \
-max muxing_queue_size 1024 \
-f flv "rtmp://live-api-s.facebook.com:80/rtmp/YOURAPIKEY"

ok lets break this down a bit:

-r is for output framerate

-ar is for audio rate

-s is for scale – i.e. the size of the video

-c:a is for audio encoding – note that this can be replaced by aac on some distribution

< Back to all articles