Origin Application - Storm Streaming Server

An Origin-type application is one of the core modules used to build clusters in the Storm Streaming Server. This guide provides information about all its parameters and settings.

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 and transcode applications

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

                        
<Application name="origin" type="origin">

    <!--
        Cluster Connection Settings
    -->
    <StreamingClusterSettings>
        <SupervisorList>
            <ClusterManager host="mydomain.com" port="443" isSSL="false">
                <Priority>1</Priority>
                <Secret>qwerty*1234556</Secret>
            </ClusterManager>
        </SupervisorList>
        <PeerAccessSettings host="mydomain.com" port="443" isSSL="false"/>
    </StreamingClusterSettings>

    <!--
        General configuration settings related to this application and its streams.
    -->
    <GeneralSettings>
		<Description>Default application</Description>
		<BroadcastLimit>unlimited</BroadcastLimit>
		<StatInterval>2</StatInterval>
	</GeneralSettings>

    <!--
        Configuration related to ingesting streams into the application.
    -->
    <IngestSettings>
		<AllowStreamIngest>true</AllowStreamIngest>
		<AutoStreamPublish>true</AutoStreamPublish>
		<AllowStreamOverwrite>true</AllowStreamOverwrite>
		<Authorization enabled="false" type="request">
			<RequestURL>https://acme.com/auth/${streamKey}</RequestURL>
			<XApiKey>as33dd4we34x5srxw6tbn</XApiKey>
		</Authorization>
	</IngestSettings>

    <!--
        Basic MP4 muxing settings.
    -->
	<MP4MuxerSettings>
		<VariableFPS>true</VariableFPS>
		<KeyFrameCompensation>false<KeyFrameCompensation>
	</MP4MuxerSettings>

    <!--
        Recording configuration for saving live streams to disk.
    -->
	<RecordingSettings enabled="false">
		<FileFormat>fMP4</FileFormat>
		<SavePath>/Users/szymon/Desktop</SavePath>
        <MaxFileSize>10</MaxFileSize>
        <MaxFileDuration>10</MaxFileDuration>
        <CacheSize>1</CacheSize>
        <MaxStorageSize>1500</MaxStorageSize>
        <RemoveOldFiles>true</RemoveOldFiles>
	</RecordingSettings>

    <!--
        List of enabled live transcoding presets for this application.
    -->
	<LiveTranscoding enabled="true">
		<Preset name="360p" />
		<Preset name="480p" />
        <Preset name="720p" />
	</LiveTranscoding>

</Application>
                    

Main Parameters Explanation

Application:name Name of this application. If there are more applications within your config/preferences.xml they all must have unique names.
Application:type This value must be set to origin for this type of Application. Other types are live (which you can learn more about here), transcode (which you can learn more about here) and edge (which you can learn more about here).
Table 1. Main parameters table

StreamingClusterSettings

This block defines a list of ClusterManagers to which information about streams and their status within the cluster is sent. Later, edge or transcode applications connected to these same ClusterManager will be able to locate the stream on the appropriate server with an Origin-type application.

It is possible to define more than one ClusterManager in the list for the purpose of redundancy.

ClusterManager:host URL or IP to a server hosting ClusterManager instance.
ClusterManager:port Port for ClusterManager 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 (like edge or transcode) 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. StreamingClusterSettings table

GeneralSettings

This block defines general configuration settings for the application itself.

Description A custom description of the application explaining its purpose and functionality.
BroadcastLimit Specifies the maximum number of concurrent broadcasts allowed within this application.
StatInterval Determines how frequently statistics are processed for this application, expressed in seconds (2 seconds by default).
Table 3. GeneralSettings table

IngestSettings

This settings block manages stream publishing to the application.

AllowStreamIngest Specifies whether publishing streams to this application is allowed (e.g., via OBS).
AutoStreamPublish Determines whether a newly created stream is automatically set to PUBLISHED, allowing immediate playback.
AllowStreamOverwrite Defines whether existing streams can be overwritten by new incoming ones.
Table 4. IngestSettings table

Authorization:enabled If set to true, stream ingest authorization is required.
Authorization:type

Specifies the active authorization method.

  1. URL-based Authorization

    Sample configuration:

                            
    <Authorization enabled="true" type="request">
         <RequestURL>https://acme.com/api/storm/auth/{streamKey}</RequestURL>
         <XApiKey>bd34ddawe34v51rxw6tbn</XApiKey>
    </Authorization>
                                                    

    Supported request template variables:

    • {streamKey} – Stream key of the requested stream
    • {username} – Username used for authentication
    • {ipAddress} – IP address of the incoming connection

    Expected JSON response format:

                            
    {
      "username": "admin",
      "password": "qwerty"
    }
                                                    

    HTTP response codes:

    • 200 – OK
    • 401 – Access Denied
    • 404 – Not Found
    • (other standard codes apply)
  2. File-based Authorization

    Sample configuration:

                            
    <Authorization enabled="true" type="file">
         <FileURL>/home/storm/server/config/auth_publish.xml<FileURL>
    </Authorization>
                                                    

    Required XML structure:

                            
    <?xml version="1.0" encoding="UTF-8" ?>
    <Authorization version="1.0">
        <AuthorizationList>
            <AuthItem username="admin" password="qwerty" />
            <AuthItem username="john" password="superpass" />
        </AuthorizationList>
    </Authorization>
                                                    
  3. Local Authorization

    Sample configuration:

                            
    <Authorization enabled="true" type="local">
        <AuthorizationList>
            <AuthItem username="admin" password="qwerty" />
            <AuthItem token="62cjdj" expire="2022-02-01 16:22:00" />
        </AuthorizationList>
    </Authorization>
                                                    
    Token-based AuthItem entries are only supported when using the local authorization type.
Table 5. Ingest authorization settings table

MP4MuxerSettings

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

VariableFPS If 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.
KeyFrameCompensation Enables mechanism where “empty” frames are inserted into a stream if Audio/Video desynchronization is detected.
Table 6. MP4MuxerSettings table

RecordingSettings

Recording option allows for recording video streams into media 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 7. RecordingSettings table

LiveTranscoding

For each individual application a set of presets for transcoding can be selected. Please keep in mind that presets must be already defined in your config/preferences.xml file. If you would like to define your own presets and learn more about transcoding check our Transcoding Guide.

LiveTranscoding:enabled If set to false, no video stream will be transcoded.
preset:name Name of a template, previously defined in main Transcoder tag.
Table 8. LiveTranscoding table
Support Needed?

Create a free ticket and our support team will provide you necessary assistance.