Live Application - Storm Streaming Server

Applications are separate group of streams with specific set of parameters and settings. An application defines how streams can be published and viewed.

Sample configuration

Live-type applications are the simplest and are best suited for single-instance configurations. If you wish to create a origin-edge configuration, please check the other types.

The basic live-type application configuration stored in config/preferences.xml looks as follow:

                        
<Application name="live" type="live">

    <RTMPController>
		<AllowStreamPublish>true</AllowStreamPublish>
		<AllowStreamOverwrite>true</AllowStreamOverwrite>
		<AllowClientPlayback>true</AllowClientPlayback>
		<KeepClientStreamsAlive>true</KeepClientStreamsAlive>
		<PlaybackAuthRequired>false</PlaybackAuthRequired>
		<Authorization enabled="false" sourceType="local" sourceTarget="none">
			<Auth username="admin" password="admin" />
			<Auth token="62cjdj" expire="2022-02-01 16:22:00" />
		</Authorization>
	</RTMPController>

	<SecureStream enabled="false">
		<Password>qwerty</Password>
		<CheckViewerIP>true</CheckViewerIP>
		<TokenLifespan>10</TokenLifespan>
	</SecureStream>

	<MP4MuxerSettings>
		<VariableFPS>true</VariableFPS>
		<KeyFrameCompensation>false</KeyFrameCompensation>
	</MP4MuxerSettings>

	<DVRSettings enabled="false">
		<CacheSize>100</CacheSize>
	</DVRSettings>

	<RecordingSettings enabled="false">
		<SavePath>/Users/Johny/Desktop</SavePath>
		<CacheSize>15</CacheSize>
	</RecordingSettings>

	<TranscoderSettings enabled="true">
		<Preset name="720p" />
		<Preset name="360p" />
	</TranscoderSettings>

</Application>
                    

Main parameters explanation

Application:nameName of this application. If there are more applications within your preferences .xml they all must have unique names.
Application:typeThis value must be set to live for this type of Application.
Table 1. Main parameters table

RTMPController

This block of settings specifies the exact behavior for RTMP-based connections.

AllowStreamPublishDefines whether publishing to this application is allowed or not.
AllowStreamOverwriteIf this option is set to true, a stream can be overwritten by another stream with the same name.
AllowClientPlaybackDefines whether playback from this application is possible for RTMP
KeepClientStreamsAliveIf this option is set to false, any RTMP created through the pull mechanism (from an external RTMP server) will be closed if the number of viewers drops to zero and remains at that level for 30 seconds.
PlaybackAuthRequiredIf this option is set to true all RTMP clients must authorize for playback using either a token or credentials
Table 2. RTMP connections table

To enable authorization for Publish or Playback Authorization block must be configured:

Authorization:enableIf true authentication is enabled and required (by default only for publishing). If you wish to authenticate client (playback) connection PlaybackAuthRequired must be set to true.
sourceTypePossible values:

local – you can define auth items within Authorization tag in the following manner:

<auth username="admin" password="qwerty" />
<auth token="62cjdj" expire="2022-02-01 16:22:00" />

global – application will use global pool of users and tokens for authorization. This pool is defined in <StreamAuthorization> tag.

request – server will perform a request to an URL specified in parameter sourceTarget to grab a list of authentication items. A response should looks as follow:

{
 "status":"success",
 "data":[
  {
   "username":"admin",
   "password":"qwerty"
  },
  {
  "token":"62cjdj",
  "expire":"2022-02-01 16:22:00"
  }
 ]
}
sourceTargetAn URL where request should be made for auth items (only for sourceType:request).
Table 3. RTMP authorization table

SecureStream Settings

SecureStream allows to protect stream playback using a special token. Can will change depending on viewer’s IP (optionally) or time. If you wish to learn more about this function, check our guide for SecureStream.

SecureStream:enableDefines whenever SecureStream is enabled for this application or not.
PasswordUnique password that will be used for creating a token.
CheckViewerIPDefines whenever viewer’s IP should be used to create a token.
TokenLifespanDefines token’s lifespan (in minutes).
Table 4. SecureStream settings table

MP4 Muxer Settings

MP4MuxerSettings block defines basic options for MP4 packager that is used for MSE/HLS connections

VariableFPSIf the source stream has no const frame rate (e.g. WebRTC-based source) muxer will try to fix the stream by adjusting composition times for selected frames.
KeyFrameCompensationEnables mechanism where “empty” frames are inserted into a stream if Audio/Video desynchronization is detected.
Table 5. MP4 muxer settings table

DVR Settings

DVR function allows for short live-stream rewind mechanism based on cached stream.

DVRSettings:enabledDefines whenever DVR is enabled.
CacheSizeNumber of MB within memory for storing video stream. Length of stored video material will depend on resolution and bitrate.
Table 6. DVR settings table

Recording Settings

Recording option allows for recording video streams into MP4 files.

RecordingSettings:enabledDefines whenever recording is enabled.
SavePathPath were MP4 files should be saved.
CacheSizeDefines how much of a video stream should be kept in memory before being flushed to a file.
Table 7. Recording settings table

Transcoding Settings

For each individual application a set of presets for transcoding can be selected.

TranscoderSettings:enabledIf set to false, no video stream will be transcoded.
preset:nameName of a template, previously defined in main Transcoder tag.
Table 7. Transcoding settings table