Cheatsheet Pages / FFmpeg Cheatsheet

How to stream a file to YouTube Live or Twitch — ffmpeg RTMP

You want to push a file (or loop it) to an RTMP endpoint.

ffmpeg -re -i input.mp4 -c:v libx264 -preset veryfast -b:v 2500k -c:a aac -b:a 128k -f flv rtmp://live.example.com/app/STREAM_KEY
# -re reads input at native frame rate; replace the URL and key with yours

Good to know

-re reads the input at its native frame rate — without it you would blast the whole file at the server at once. Replace the URL and stream key with yours.

FFmpeg Cheatsheet one-page card — 28 commands that actually work
The full one-page card — FFmpeg Cheatsheet. Get the complete cheatsheet on GitHub