Connect an RTSP encoder or IP camera 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 or IP camera that supports the RTSP 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 RTSP-based encoder or IP camera as the video source for a Wowza Streaming Cloud ultra low latency stream.

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 Get started with ultra low latency streaming using the Wowza Streaming Cloud REST API.

If you want Wowza Streaming Cloud to pull the stream from the RTSP encoder or IP camera, create an ultra low latency stream target for a pull stream.

Refer to documentation for your source encoder or camera 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

Notes:
  • To authenticate API requests, use HMAC authentication for production environments. For testing or proof of concept purposes only, use API key and access key authentication.
  • The curl examples below use environment variables. See Using cURL for more information on how to set these up.
  • 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 when setting up environment variables for your API request.

curl -X POST \
-H "Content-Type: application/json" \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
-d '{
    "stream_target_ull": {
	"name": "My Ultra Low Latency Pull Target",
	"source_delivery_method": "pull",
	"enable_hls": true,
	"source_url": "rtsp://example.com/video"
    }
}' "${WSC_HOST}/api/${WSC_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:

{
  "stream_target_ull": {
    "id": "vpxfks4v",
    "name": "My Ultra Low Latency Pull Target",
    "enabled": true,
    "state": "stopped",
    "source_delivery_method": "pull",
    "source_url": "rtsp://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: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \ 
"${WSC_HOST}/api/${WSC_VERSION}/stream_targets/ull"

View the details of an ultra low latency stream target:

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \ 
"${WSC_HOST}/api/${WSC_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 -X PATCH \
-H "Content-Type: application/json" \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
-d '{
      "stream_target_ull": {
        "name": "My Awesome Ultra Low Latency Pull Stream Target",
    }
}' "${WSC_HOST}/api/${WSC_VERSION}/stream_targets/ull/[ull_stream_target_id]"

Delete an ultra low latency stream target:

curl -X DELETE \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \ 
"${WSC_HOST}/api/${WSC_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.

For an RTSP pull connection, such as an IP camera, you configure the source by determining and providing the source_url value when creating the ultra low latency stream target. The source_url for your camera must include a publicly accessible hostname or IP address.

Start streaming


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

More Resources