Origin 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
An origin application is the basis for creating video streaming clusters. It is very similar to a live application, with just a few minor differences. A single origin-type application will accept multiple connections from edge-type applications
The basic origin-type application configuration stored in config/preferences.xml looks as follow:
<Application name="origin" type="origin">
<StreamingClusterSettings>
<SupervisorList>
<ClusterManager host="mydomain.com" port="443" isSSL="false">
<Priority>1</Priority>
<Secret>qwerty*1234556</Secret>
</ClusterManager>
<PeerAccessSettings host="mydomain.com" port="1935" isSSL="false"/>
</SupervisorList>
</StreamingClusterSettings>
<RTMPController>
<AllowStreamPublish>true</AllowStreamPublish>
<AllowStreamOverwrite>true</AllowStreamOverwrite>
<AllowClientPlayback>true</AllowClientPlayback>
<AutoPublishStream>true</AutoPublishStream>
<KeepClientStreamsAlive>true</KeepClientStreamsAlive>
<PlaybackAuthRequired>false</PlaybackAuthRequired>
<Authorization enabled="false" sourceType="local">
<Auth username="admin" password="qwerty" />
<Auth token="62cjdj" expire="2022-02-01 16:22:00" />
</Authorization>
</RTMPController>
<RecordingSettings enabled="false">
<SavePath>/Users/Johny/Desktop</SavePath>
<CacheSize>15</CacheSize>
<MaxFileSize>15</MaxFileSize>
<MaxFileDuration>0</MaxFileDuration>
<MaxStorageSize>0</MaxStorageSize>
<RemoveOldFiles>true</RemoveOldFiles>
</RecordingSettings>
<TranscoderSettings enabled="true">
<Preset name="720p" />
<Preset name="360p" />
</TranscoderSettings>
</Application>
Main Parameters Explanation
Application:name | Name of this application. If there are more applications within your preferences.xml they all must have unique names. |
Application:type | This value must be set to “origin” for this type of Application. |
Table 1. Main parameters table
Streaming Cluster Settings
This block defines a list of ReverendMothers to which information about streams and their status within the cluster is sent. Later, Edge-type applications connected to these same ReverendMothers will be able to locate the stream on the appropriate server with an Origin-type application.
It is possible to define more than one ReverendMother in the list for the purpose of redundancy.
ClusterManager:host | URL or IP to a server hosting ReverendMother instance. |
ClusterManager:port | Port for ReverendMother connection. |
ClusterManager:isSSL | True/false depending on whenever SSL layer is required. |
Priority | Priority for ClusterManager (if more available). Higher the number, higher the priority. |
Secret | A secret for connection authorization. |
PeerAccessSettings:host | Public host or IP address of this application, so other applications (edge) know where to connect. |
PeerAccessSettings:port | Public port of this application, so other applications know where to connect (indicate a port with an active RTMP protocol). |
PeerAccessSettings:isSSL | Whether the connection should use SSL. |
Table 2. Streaming cluster settings table
RTMPController
This block of settings specifies the exact behavior for RTMP-based connections.
AllowStreamPublish | Defines whether publishing to this application is allowed or not. |
AllowStreamOverwrite | If this option is set to true, a stream can be overwritten by another stream with the same name. |
AllowClientPlayback | Defines whether playback from this application is possible for RTMP |
AutoPublishStream | Defines whether a stream is published by default or not. A stream cannot be viewed unless it's published (via Control Panel, or Rest-API) |
KeepClientStreamsAlive | If 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. |
PlaybackAuthRequired | If this option is set to true all RTMP clients must authorize for playback using either a token or credentials |
Table 3. RTMP connections table
Recording Settings
Recording option allows for recording video streams into MP4 files.
RecordingSettings:enabled | Defines whenever recording is enabled. |
SavePath | Path were MP4 files should be saved. |
CacheSize | Defines how much of a video stream should be kept in memory before being flushed to a file. |
MaxFileSize | Maximum video file size. If a stream reaches this size, it will be split into additional files. This parameter is optional, and if not present or set to zero, no limit will be in effect. |
MaxFileDuration | Maximum video file duration (time). If a stream exceeds this duration, it will be split into multiple files. This parameter is optional, and if not specified or set to zero, there will be no limit in effect. |
MaxStorageSize | Storm will calculate sum of all saved video files in particular folder and either stop saving new ones, or it'll start overwriting older files if RemoveOldFiles is set to true. This parameter is optional and if not present or set to 0 no limitation will be added. |
RemoveOldFiles | If set to true and combined with MaxStorageSize, older video files will be removed to make space for new ones. |
Table 4. Recording settings table
Transcoding Settings
For each individual application a set of presets for transcoding can be selected.
TranscoderSettings:enabled | If set to false, no video stream will be transcoded. |
preset:name | Name of a preset, previously defined in main Transcoder tag. |
Table 5. Transcoding settings table