How to use FFMPEG sending FLV to Wowza in security & secured token for other RTMP access

Operation diagram

滑動1The communication between the origin server and all Edges is with Secure Token Authentication

Before configuration, it’s required for MediaSecurity Addon, please download the appropriated one as below

Version for Wowza Media Server 2.0.0 to Wowza Media Server 3.1.2.x
MediaSecurity_2.0.zip
Version for Wowza Media Server Pro 1.7.x
MediaSecurity.zip

After downloaded, unzip the file, copy [MediaSecurity Folder]/lib/* to [WowzaInstallFolder]/lib

The reference link as below

http://www.wowza.com/forums/content.php?450 : How to protect RTMP streaming using SecureToken (ModuleSecureToken)

http://www.wowza.com/forums/content.php?233-How-to-secure-publishing-from-an-RTMP-encoder-that-does-not-support-authentication-(ModuleSecureURLParams)

  1. To configure URLparam method for not-support Authentication encoder like FFMPEG on the Origin Server, Open [install-dir]/conf/[application]/Application.xml in a text editor and add the following definition as the last entry in the list:
    <Module>
        <Name>ModuleSecureToken</Name>
        <Description>ModuleSecureToken</Description>
        <Class>com.wowza.wms.security.ModuleSecureToken</Class>
    </Module>

    Note: If you are running Wowza Media Server 3.1.2 or earlier, add the following <Module&gt definition as the last entry in the <Module&gt list instead:

    <Module>
    	<Name>ModuleSecureToken</Name>
    	<Description>ModuleSecureToken</Description>
    	<Class>com.wowza.wms.plugin.security.ModuleSecureToken</Class>
    </Module>

    However, for this case, no need to add the above definition. Instead, adding the following definition:

    <Module>
    	<Name>ModuleSecureURLParams</Name>
    	<Description>ModuleSecureURLParams</Description>
    	<Class>com.wowza.wms.security.ModuleSecureURLParams</Class>
    </Module>

    If you are running Wowza Media Server 3.1.2 or earlier, add the following <Module> definition as the last entry in the <Modules> list instead:

    <Module>
    	<Name>ModuleSecureURLParams</Name>
    	<Description>ModuleSecureURLParams</Description>
    	<Class>com.wowza.wms.plugin.security.ModuleSecureURLParams</Class>
    </Module>

    The next, To protect publishing, add the following property to the application-level properties at the bottom of the Application.xml file (be sure to get the correct <Properties> container – there are several in the file).

    <Property>
    	<Name>secureurlparams.publish</Name>
    	<Value>12345.doPublish</Value>
    </Property>
  2. To enable SecureToken on the origin server to secure communication with Edges.
    Add the following property to the application-level <Properties> container at the bottom of the Application.xml file (be sure to get the correct <Properties> container – there are several in the file):

    <Property>
    	<Name>secureTokenSharedSecret</Name>
    	<Value>[secure-token-secret]</Value>
    </Property>

    Replace [secure-token-secret] with your SecureToken secret. An example is:

    <Property>
    	<Name>secureTokenSharedSecret</Name>
    	<Value>#ed%h0#[email protected]</Value>
    </Property>
  3. The URL setting on the Encoder
    For FFMPEG:
    rtmp://[wowza-address]:1935/live?doPublish=12345/streamname
    
    In FMLE, you can use this:
    rtmp://[wowza-address]:1935/live?doPublish=12345
  4. The configuration on each of Edges, editing the Application.xml at [WowzaInstallFolder]/conf/[Application]/. The first property is configured for other RTMP access secure token, the second is the secure token provided by the Origin server, and the last property is for SecureURLParams access.
    <Properties>
    	<Property>
    	        <Name>secureTokenSharedSecret</Name>
    		<Value>#ed%h0#[email protected]</Value>
    	</Property>
    	<Property>
    	        <Name>secureTokenOriginSharedSecret</Name>
    		<Value>#ed%h0#[email protected]</Value>
    	</Property>
    	<Property>
    		<Name>secureurlparams.publish</Name>
    		<Value>54321.doPublish</Value>
    	</Property>
    </Properties>