Flussonic Media Server Documentation

Pushing a Stream to Other Servers

How to copy (push) a stream to other servers

You can tell Flussonic to copy a stream to other servers (for example, CDNs,) by using the push directive. In this example, we push a stream to a CDN:

stream breakingnews {
  url publish://;
  push rtmp://localhost:1935/static/breakingnews1;
  push tshttp://localhost:8080/breakingnews2/mpegts;
  push hls://cdn3/breakingnews3 disabled;
}

The push directive supports the RTMP, HTTP MPEG-TS, and HLS protocols.

How to manage pushed streams

If the stream configured with push and has become offline, then Flussonic by default tries to push this unavailable stream. With a large number of streams sent to other servers via push, this can lead to a critical increase in the load on the server's CPU.

However, Flussonic can monitor streams that it sends to other servers and collect statistics on unsuccessful sending attempts.

A visual display of push statuses in the UI will help you take action — stop (pause) offline streams or limit attempts to send them.

Push statuses are shown as indicators on the main page in the Streams list and in stream settings on the Output tab (Push live video to certain URLs). The reason for stopping the pushing process can be found in the logs.

Flussonic push options

To control how streams are sent via push and prevent CPU overuse if there are many offline streams, use the options:

  • retry_timeout (Timeout in the UI) — how often Flussonic should retry attempts to send the stream. It is an interval in seconds, 5 seconds by default.

    You can increase Timeout to reduce server load.

    push rtmp://example.com:1935/live/STREAM_NAME retry_timeout=10;
    
  • retry_limit (Limit in the UI) — how many times in a row Flussonic should retry attempts to send a stream. The default limit is 100.

    You can set Limit to limit the number of attempts to send a stream. After this limit is reached, the stream will have the 'error' status.

    push rtmp://example.com:1935/live/STREAM_NAME retry_timeout=10 retry_limit=5;
    
  • disabled (Enable turned off in the UI) — disable sending the stream.

    Temporary disabling, or pausing, an offline stream eliminates the necessity to remove it from the the configuration in order to stop Flussonic trying to push it. In this way, the URL and other settings of a disabled stream remain in Flussonic.

    push rtmp://example.com:1935/live/STREAM_NAME retry_timeout=10 retry_limit=5 disabled;
    

Example: pushing a stream to the Akamai CDN

stream breakingnews {
  url publish://;
  segment_count 10;
  segment_duration 10;
  push hls://post.[HOSTNAME].akamaihd.net/[STREAM ID]/[ANY STREAM NAME]/;
}