Flussonic Media Server documentation

Contents

Publishing to a static stream

Here we will talk about how to set up video publishing and how these settings were different in previous versions of Flussonic Media Server.

URLs for accessing a published stream via various protocols are listed in Publishing.

Starting from version 19.01, Flussonic Media Server uses a new parameter to set up video publishing to a static stream. The new parameter url publish:// automatically replaces the old publish_enabled when you save the Flussonic's configuration file.

Warning! We recommend that you make a backup copy of Flussonic configuration file before making any changes to it in version 19.01. The updated configuration file will become incompatible with previous versions of Flussonic.

How to set up publication in version 19.01 and higher:

stream published {
    url publish://;
}

How it was in versions prior to 19.01 — do not use now:

# deprecated notation
stream published {
    publish_enabled;
}

The new parameter 'url publish://' offers more opportunities to manage streams with published sources. It allows you to:

Switching stream sources, using timeout

In previous versions, you could only turn the publishing source on and off by changing the settings.

Now the rules of switching sources according to their priority and state (whether a source is available or not) apply to published sources too. This means that now you can add alternative sources to a stream with a published source and use timeout for switching between sources.

If a published source is unavailable, Flussonic immediately switches by default to the next source. Alternatively, you can specify your custom timeout.

Example with multiple sources and a timeout:

stream published {
    source_timeout 3;
    url publish://;
    url file://vod/stub.mp4;
    ...
}

You can also specify timeout for each source individually:

stream published {
    url publish:// source_timeout 3;
    url file://vod/stub.mp4 source_timeout 2;
}

Prohibiting the publication, the event publish_forbidden

When the source url publish:// has a lower priority than the other specified stream sources, it might mean that the publication will not actually happen. You can prevent the publication and allow it again by changing the priority of sources. This can be done during the broadcast.

If publishing is not possible, Flussonic generates the event publish_forbidden. For example, this event occurs with the following configuration if the file stub.mp4 exists and is successfully played:

stream published {
    source_timeout 3;
    url file://vod/stub.mp4;
    url publish://;
    ...
}

To allow publication, put the source of publication before the file.

Transcoding of a published source

Specify the transcoder parameter in the stream settings to transcode a source stream. Flussonic supports such configuration for RTMP streams. For WebRTC, the transcoder parameter will be added in future versions, but now you can use WebRTC-specific options (read later on this page).

stream published {
    source_timeout 3;
    url publish://;
    url file://vod/stub.mp4;
    transcoder vb=2048k size=1280x720 preset=fast ab=128k;
}

WebRTC streams support

For WebRTC sources, you can use WebRTC-specific transcoding options with 'url publish://'.

Syntax of transcoding options for WebRTC streams:

url publish:// [output_audio=(aac|aac_opus|opus)] [prefer_codec=(h264|vp8|vp9)]

  • output_audio=(aac|aac_opus|opus). Specifies audio transcoding options. You can get the resulting stream for playback in AC, AAC+Opus, or Opus. By default, aac_opus is used – input streams, which usually have audio in Opus, receive also a track in AAC on the output.

  • prefer_codec=(h264|vp8|vp9). Offers to choose one of the listed video codecs at the start of the publication. The default codec is H264. Video encoded in VP8 and VP9 is now transferred without transcoding, its support will be added in the future.

Example:

stream published {
    url publish:// output_audio=aac;
}