• How to dynamically resolve edge server stream requests to origin servers (StreamResolver)

    The ModuleStreamResolver module for Wowza Streaming Engine™ media server software enables edge servers in a live stream repeater (origin/edge) configuration to dynamically resolve client requests for streams to multiple origin servers.

    Contents


    Prerequisites
    Installation
    Wowza Streaming Engine edge server configuration
    Wowza Streaming Engine edge server properties
    Wowza Streaming Engine origin server configuration
    Wowza Streaming Engine origin server properties
    Usage
    For developers
    More resources

    Prerequisites


    Wowza Streaming Engine 4.0.0 or later is required.

    Installation


    1. Download wse-plugin-streamresolver.zip. Do this on all origin and edge servers in your live stream repeater configuration.

    2. Extract the contents from the downloaded (zipped) package, and then copy the lib/wse-plugin-streamresolver.jar file from the package to the lib folder in your Wowza Streaming Engine installation ([install-dir]/lib).

    3. Restart Wowza Streaming Engine.

    Wowza Streaming Engine edge server configuration


    On each edge server in your live stream repeater setup, add the following module definition to your live application configuration. See Configure modules for details.

    Name
    Description
    Fully Qualified Class Name
    ModuleStreamResolver Resolves streams from origin dynamically. com.wowza.wms.plugin.streamresolver.ModuleStreamResolver

    Wowza Streaming Engine edge server properties


    After enabling the module on each edge server, you can adjust the default settings by adding the following properties to your live application. See Configure properties for details.

    Path
    Name
    Type
    Value
    Notes
    /Root/Application wowzaResolverConfTargetPath String [install-dir]contentorigins.txt Path to a file that has a list of origin servers (one per line). (default: not set)
    /Root/Application wowzaResolverOriginServers String server1.com,server2.com If the wowzaResolverConfTargetPath property isn't set, you can use this property to define a comma-delimited list of origin servers. (default: not set)
    /Root/Application wowzaResolverProtocol String rtmp Protocol to use when connecting to origin servers (rtmp or wowz). (default: rtmp)
    /Root/Application wowzaResolverUDPClientPort Integer 9777 UDP port to use for edge/origin communication. (default: 9777)
    /Root/Application wowzaResolverUDPClientTimeout Integer 2000 Time (in milliseconds) before timing out the connection to an origin server. (default: 2000)
    /Root/Application wowzaResolverOriginApplicationName String live (Optional) By default, the edge server application looks for streams on the origin server application with the same name. Use this property to define a different application name on the origin server in which to look for streams. (default: uses requested edge application name)
    /Root/Application wowzaResolverOriginApplicationInstanceName String _definst_ (Optional) By default, the edge server application looks for streams on the origin server application with the same application instance name. Use this property to define a different application instance name on the origin server in which to look for streams. (default: uses requested edge application instance name)
    /Root/Application wowzaResolverOriginStreamName String myStream (Optional) By default, the edge server application looks for streams on the origin server application/application instance with the same stream name. Use this property to define a different stream name on the origin server to look for. (default: uses stream name requested from edge).

    Note: If the wowzaResolverConfTargetPath AND wowzaResolverOriginServers properties are not set, then the list of origin servers specified in the <Repeater>/<OriginURL> property in the application's Application.xml file is used.

    Wowza Streaming Engine origin server configuration


    On each origin server in your live stream repeater setup, add the following server listener definition to your media server. See Configure server listeners for details.

    Fully Qualified Class Name
    com.wowza.wms.plugin.streamresolver.ServerListenerLocateSourceStream

    Wowza Streaming Engine origin server properties


    After enabling the server listener on each origin server, you can adjust the default settings by adding the following properties to your live application. See Configure properties for details.

    Path
    Name
    Type
    Value
    Notes
    /Root/Server wowzaSourceStreamUDPListenerDebug Boolean false Debug inbound connections to your origin server from edge requests. (default: false)
    /Root/Server wowzaSourceStreamUDPListenerPort Integer 9777 UDP port to use for origin/edge communication. (default: 9777)
    /Root/Server wowzaSourceStreamHostName String mycompany.com] The origin server's public hostname. (default: null)

    Usage


    When a client/player requests a stream from an edge server, the edge will first look for existing streams that it has already requested for a match. If none are found, it then queries the defined list of origin servers to return the requested stream. The edge server will connect to the origin server that responds first with a valid stream, and then serve that stream to the client/player.

    For developers


    Source code is available on GitHub.

    Wowza Media Systems™ provides developers with a platform to create streaming applications and solutions. See Wowza Developer Tools to learn more about our APIs and SDK.

    More resources

    How to configure a live stream repeater
    Wowza media server software and all components, including modules, source code, and other related items offered on this page, are copyrighted (c) 2006-2016 by Wowza Media Systems, LLC, all rights reserved, and are licensed pursuant to the Wowza Media Software End User License Agreement.
    Originally Published: For Wowza Streaming Engine on 04-14-2016.

    If you're having problems or want to discuss this article, post in our forum.