FFmpeg is a free command-line encoder. It is ideal for sending a file, a capture device or another stream to your channel from a server or a small always-on machine.
1. Find your encoder settings
Everything your encoder needs is in your account: sign in, click Streaming in the left menu, open your service, and scroll down its Overview to the Live stream to service box. It lists four values, each with a copy button:
- Server URL: the RTMP address your encoder sends to
- Stream Name: the name of the stream. On a TV station it is
live. - Username and Password: the publishing login for your channel. This is not the email and password you use to sign in to Stream Brothers. The password is blurred: click it to see it.
If the box also shows a Stream Key line, your channel accepts a single key instead: you can use the Stream Key wherever this guide says Stream Name, and leave the username and password out. If it shows Sign-in: None, your channel needs no login at all: leave those fields empty. The video dashboard tutorial shows the box with pictures.
Copy them across rather than typing them. A single wrong character in the server address or stream name and the connection is simply refused.
2. The command
Replace the UPPERCASE parts with your values from the Live stream to service box:
ffmpeg -re -i INPUT \
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 6000k \
-r 30 -g 60 -keyint_min 60 -sc_threshold 0 -pix_fmt yuv420p \
-c:a aac -b:a 128k -ar 48000 -ac 2 \
-f flv "rtmp://USERNAME:PASSWORD@SERVER-WITHOUT-RTMP-PREFIX/STREAM-NAME"
For the last line: take your Server URL, put USERNAME:PASSWORD@ right after rtmp://, and add / and your Stream Name at the end. If your password has symbols such as @ or :, click New password in the Live stream to service box to get one without, or URL-encode them.
3. What the flags do
-rereads a file at real speed. Leave it out for a live device or stream.-i INPUTis your source: a file such as/home/me/show.mp4, a camera, or another stream URL. Add-stream_loop -1before-ito loop a file forever.-c:v libx264 -preset veryfast -b:v 3000kencodes H.264 at about 3 Mbps; keep it under your plan's 5 Mbps.-r 30 -g 60 -keyint_min 60 -sc_threshold 0gives 30 fps with a fixed keyframe every 2 seconds.-c:a aac -b:a 128kis AAC audio at 128 kbps.-f flvis the container RTMP needs.
Check that it is live
Back on the Streaming page, your service shows a green LIVE badge on its Overview within a few seconds of your encoder connecting. Then open your player (the Player page link under Widgets & Links) in another browser or on your phone and watch a minute of it yourself before you announce the stream. Viewers usually see the picture 10 to 20 seconds behind real time; that delay is normal.
If it will not connect
- Re-copy the Server URL and Stream Name from the Live stream to service box. The most common mistake is putting the stream name on the end of the server address as well as in its own box.
- Make sure you used the channel's publishing Username and Password, not your account login. If you clicked New password in the Live stream to service box, update it in your encoder too.
- Only one encoder can publish to a stream name at a time. Stop any other encoder sending to it.
- Still stuck? Start a chat with us from any page: we can see whether your encoder reached the server and why it was turned away.