Connect an RTMP encoder to Wowza Streaming Cloud with Ultra Low Latency using the Wowza Streaming Cloud REST API

The Wowza Streaming Cloud™ service with Ultra Low Latency can connect to any H.264 encoder that supports the RTMP network protocol. This article describes how to use the Wowza Streaming Cloud REST API to create an ultra low latency stream target and configure an RTMP-based encoder as the video source for a Wowza Streaming Cloud ultra low latency stream.

Video Tutorial: Sending an RTMP Stream to Wowza Streaming Cloud with Ultra Low Latency


Create an ultra low latency stream target


Start by creating an ultra low latency stream target using the Wowza Streaming Cloud REST API. For detailed information about ultra low latency stream target parameters, see the Get started with ultra low latency streaming using the Wowza Streaming Cloud REST API.

Notes:
  • Ultra low latency stream targets are not available in the sandbox environment, so be sure to use https://api.cloud.wowza.com not https://api-sandbox.cloud.wowza.com in your API request.
  • For [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
  • For [version], substitute the version number of the API that you're using. For the current version, use v1.2.

Push source delivery method

Create an ultra low latency stream target for a push stream if you want your video source to push the stream to Wowza Streaming Cloud.

Example request and response

curl -H "wsc-api-key: [key]" -H "wsc-access-key: [key]" -H "Content-Type: application/json" -X POST -d '{
    "ull_stream_target": {
	"name": "My Ultra Low Latency Push Target",
	"source_delivery_method": "push",
	"enable_hls": true
    }
}' "https://api.cloud.wowza.com/api/[version]/stream_targets/ull"

The request creates an ultra low latency stream target with an id parameter, ingest connection details, and playback details, including a hash of playback URLs. You will need details from this response to configure your RTMP source encoder. The response should look something like this:

{
    "ull_stream_target": {
        "id": "cetkpl5i",
        "name": "My Ultra Low Latency Push Target",
        "enabled": true,
        "state": "stopped",
        "stream_name": "0I0q1NXZhMnvjUVWWHaW3SM8LfhN5d03",
        "primary_url": "rtmp://origin.cdn.wowza.com:1935/live/0I0q1NXZhMnvjUVWWHaW3SM8LfhN5d03",
        "source_delivery_method": "push",
        "playback_urls": {
           "ws": [
               "ws://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160/stream.ws",
               "wss://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160/stream.ws"
            ],
            "wowz": [
               "wowz://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160",
               "wowzs://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160"
            ],
            "hls": [
               "https://[wowzasubdomain].akamaihd.net/hls/live/687321/0P0q1bjZhRzJxaE80b3lremtKSnZ6160/playlist.m3u8"
            ]
        },
        "connection_code": "295903",
        "connection_code_expires_at": "2018-10-26T20:46:20.000Z",
        "enable_hls": true,
        "created_at": "2018-10-25T20:46:20.000Z",
        "updated_at": "2018-10-25T20:46:20.000Z"
    }
}

Pull source delivery method

If you want Wowza Streaming Cloud to pull the stream from the video source, create an ultra low latency stream target for a pull stream.

Refer to documentation for your source encoder to determine the source_url value. The hostname or IP address used in the source_url must be publicly accessible. If authentication information, such as username and password, is included in the source_url, it can only contain alphanumeric, period (.), underscore (_), and hyphen (-) characters.

Example request and response

curl -H "wsc-api-key: [key]" -H "wsc-access-key: [key]" -H "Content-Type: application/json" -X POST -d '{
    "ull_stream_target": {
	"name": "My Ultra Low Latency Pull Target",
	"source_delivery_method": "pull",
	"enable_hls": true,
	"source_url": "rtmp://example.com/video"
    }
}' "https://api.cloud.wowza.com/api/[version]/stream_targets/ull"

The details of the new ultra low latency stream target are provided in the response, which should look something like this:

{
    "ull_stream_target": {
        "id": "vpxfks4v",
        "name": "My Ultra Low Latency Pull Target",
        "enabled": true,
        "state": "stopped",
        "source_delivery_method": "pull",
        "source_url": "rtmp://example.com/video",
        "playback_urls": {
           "ws": [
               "ws://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160/stream.ws",
               "wss://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160/stream.ws"
            ],
            "wowz": [
               "wowz://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160",
               "wowzs://edge.cdn.wowza.com/live/_definst_/0P0q1bjZhRzJxaE80b3lremtKSnZ6160"
            ],
            "hls": [
               "https://[wowzasubdomain].akamaihd.net/hls/live/687321/0P0q1bjZhRzJxaE80b3lremtKSnZ6160/playlist.m3u8"
            ]
        },
        "enable_hls": true,
        "created_at": "2018-10-19T18:47:35.000Z",
        "updated_at": "2018-10-19T18:47:35.000Z"
    }
}

Related API requests

View all ultra low latency stream targets:

curl -X GET -H "wsc-api-key: [key]" -H "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/stream_targets/ull"

View the details of an ultra low latency stream target:

curl -X GET -H "wsc-api-key: [key]" -H "wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/stream_targets/ull/[ull_stream_target_id]"

Update an ultra low latency stream target's configuration:

Note: The enable_hls and source_delivery_method parameters can't be updated.

curl -H "wsc-api-key: [key]" -H "wsc-access-key: [key]" -H "Content-Type: application/json" -X PATCH -d '{
	"ull_stream_target": {
		"name": "My Awesome Ultra Low Latency Pull Stream Target",
	}
}' "https://api.cloud.wowza.com/api/[version]/stream_targets/ull/[ull_stream_target_id]"

Delete an ultra low latency stream target:

curl -X DELETE -H "wsc-api-key: [key]" -H " wsc-access-key: [key]" "https://api.cloud.wowza.com/api/[version]/stream_targets/ull/[ull_stream_target_id]"

Configure the source


Make sure you have the latest firmware for a hardware encoder installed. See the encoder's user guide for details about how to update firmware as well as how to operate the device or software and how to specify settings such as resolution, bitrate, and frame rate.

RTMP encoder with push source delivery method

  1. For an RTMP encoder delivering a stream into Wowza Streaming Cloud over a push connection, use the primary URL value returned when you created the ultra low latency stream target to configure the source. The primary URL is the ingest location. For example:
    rtmp://origin.cdn.wowza.com:1935/live/[stream_name]

    Where [stream_name] is the alphanumeric stream name generated by Wowza Streaming Cloud to identify the specific stream.

  2. Refer to documentation for your specific encoder to note where to input the stream settings. Encoders may require the stream name value to be separated from the primary URL.

    For example, Address or URL might be:
    rtmp://origin.cdn.wowza.com:1935/live/

    While Stream or Stream key might be:
    0I0q1NXZhMnvjUVWWHaW3SM8LfhN5d03

RTMP encoder with pull source delivery method

For an RTMP encoder delivering a stream with a pull connection, you configure the source by determining and providing the source_url value when creating the ultra low latency stream target. The source_url must be an RTMP URL with a publicly accessible hostname or IP address.

Start streaming


Play a push stream

Start sending video from the video source and RTMP encoding device, and the ultra low latency steam starts.

Play a pull stream

When someone requests the stream by accessing the playback URL, the ultra low latency target ingests the stream and it starts playing. After about a minute of no requests, Wowza Streaming Cloud stops ingesting the stream.

More Resources