StreamLive Pro

Stream to StreamLive Pro with FFmpeg over RTMPS or SRT

Stream to StreamLive Pro from the FFmpeg command line over RTMPS or SRT: a working command, what each option does, keyframes every 2 seconds, and how to reconnect.

Updated · 4 min read

FFmpeg can push a live stream to StreamLive Pro like any other encoder: you encode to H.264 and AAC, wrap it in FLV, and send it to the RTMPS address from the Encoder card with the stream key added at the end. StreamLive Pro then sends that one stream to every channel you ticked. This suits a server, a small always-on computer, a camera feed you already pull with FFmpeg, or a scripted 24-hour channel.

If all you want is to play a video file as a live broadcast at a set time, you do not need FFmpeg: the Pre-recorded broadcast option does it from the dashboard (Broadcast a pre-recorded video as a live stream).

Before you start

Steps

  1. Open the Encoder card. Click New stream and choose Stream from software like OBS (RTMP / SRT). Open the RTMPS tab.
  2. Copy the address and the key. The address ends with /live/. The full output URL is the address with the key straight after it, with no space and no second slash. Keep it in an environment variable or a file only you can read, not in a shared script.
  3. Tick your channels in the Channels list and keep the Live stream page open in a browser while you test.
  4. Run the command. For a 30 fps source:

ffmpeg -re -i input.mp4 \
  -c:v libx264 -preset veryfast -b:v 4500k -maxrate 4500k -bufsize 9000k \
  -pix_fmt yuv420p -g 60 -keyint_min 60 -sc_threshold 0 \
  -c:a aac -b:a 128k -ar 44100 \
  -f flv "$SLP_URL"
  1. Check the detection. Within about ten to thirty seconds StreamLive Pro shows that the stream was detected and sends it to the ticked channels. The preview trails FFmpeg by ten to thirty seconds.
  2. End from StreamLive Pro. Press Stop stream to end on every network, then stop FFmpeg with q or Ctrl+C.
The Live stream screen: Preview, Program and the channels panel (test account).
The Live stream screen: Preview, Program and the channels panel (test account).

What each part of the command does

OptionWhy
-reReads a file at its real speed. Leave it out for a live source such as a camera or a capture device, which already arrives in real time
-c:v libx264H.264 video, the only video codec the ingest accepts
-b:v 4500k -maxrate 4500k -bufsize 9000kHolds the bitrate close to constant. 4,500 kbps is an example; pick what your upload holds
-pix_fmt yuv420pThe pixel format players expect from H.264
-g 60 -keyint_min 60 -sc_threshold 0A keyframe every 60 frames, which is every 2 seconds at 30 fps, and no extra keyframes on scene cuts. At 60 fps use 120
-c:a aac -b:a 128k -ar 44100AAC audio, 128 kbps at 44.1 kHz, the stereo values YouTube lists (YouTube Help: live encoder settings)
-f flvRTMP and RTMPS carry FLV

YouTube asks for a keyframe every 2 seconds and no more than 4, which is why the command fixes it at 2 rather than leaving it to the encoder. The bitrate choice and the arithmetic against your upload are in Upload speed and bitrate for multistreaming.

Sending over SRT instead

On a lossy line, use the SRT tab. Its address already contains the stream ID. If the broadcast shows a passphrase, add it to the URL as a passphrase option, and keep the output in MPEG-TS:


-f mpegts "srt://ADDRESS-FROM-THE-CARD&passphrase=YOUR-PASSPHRASE"

Two details from FFmpeg's documentation: its SRT latency option is in microseconds, not milliseconds, and its default mode is caller, which is what you need to push to our server. The SRT fields are explained in Stream with SRT from OBS, vMix or a hardware encoder.

Reconnecting after a drop

FFmpeg does not reconnect an output by itself; when the connection drops, the process ends. Cloudflare's page says the client must be set up to reconnect after a disconnection, and that the stream continues when it does. Run FFmpeg from a small loop or a service manager that starts it again after a few seconds. StreamLive Pro gives a dropped encoder a short window to come back before the broadcast ends; see My live stream stopped by itself.

What can go wrong

SymptomFix
"Protocol not found" for rtmps or srtYour FFmpeg build lacks TLS or libsrt. Install a full build, or use the RTMP tab
Connection refused right awayWrong key, a key from another broadcast, or a broadcast you stopped earlier. See OBS says "Failed to connect to server
Detected, but no pictureNot H.264, or no regular keyframes. Keep -c:v libx264 and the -g value
Picture runs too fast from a file-re is missing
Stutter on every networkThe bitrate is higher than the upload holds. Lower -b:v and -maxrate

Frequently asked questions

Can FFmpeg stream to YouTube and Facebook at the same time through StreamLive Pro?

Yes. FFmpeg sends one stream to StreamLive Pro and our servers send it to every channel you ticked, so the machine running FFmpeg uploads it once.

What URL does FFmpeg need?

The RTMPS address from the Encoder card with the stream key added straight after it. The address ends with /live/, so there is no extra slash.

What keyframe setting should I use in FFmpeg?

A keyframe every 2 seconds: -g 60 at 30 fps or -g 120 at 60 fps, with scene-cut keyframes turned off.

Can I use HEVC or AV1 from FFmpeg?

No. The ingest accepts H.264 video and AAC audio only.

Do I need FFmpeg to broadcast a recorded video as live?

No. The pre-recorded broadcast option plays an uploaded video as a live broadcast at the time you choose. It is on the trial, Pro and Studio, not on Creator.

Keep reading

How to stream a game to Twitch, Kick and YouTube at once

Stream a game to Twitch, Kick and YouTube at once: OBS sends one stream, StreamLive Pro sends it on, plus chat, upload, platform rules and Shorts of your best moments.

What is an ingest server in live streaming?

What is an ingest server: the address your encoder sends a live stream to, with a stream key. How ingest differs from playback, what it checks, and where to find yours.

Connect PRISM Live Studio to StreamLive Pro

Add StreamLive Pro as a custom channel in PRISM Live Studio on the computer and send one stream to YouTube, Facebook Pages, Twitch and more: steps, settings and fixes.

Connect XSplit Broadcaster to StreamLive Pro

Add a Custom RTMP output in XSplit Broadcaster with StreamLive Pro's address and key, and reach YouTube, Facebook Pages, Twitch and more from one stream: steps and fixes.

Want to try it? 7-day trial, no credit card.

Start free
Mobile app Home Help Center Guides PrivacyTermsAccessibility