Stream to Wowza CDN on Fastly with the Wowza Streaming Cloud REST API

Learn how to use the Wowza Streaming Cloud™ REST API to configure a live stream or transcoder to deliver streams over Wowza CDN on Fastly. This configuration provides an alternative integrated CDN option for reliable delivery in regions around the world.

Notes: 
  • The Wowza Streaming Cloud integration with Fastly is an alpha feature that's available in private preview. Participation is by invitation only and is subject to the terms of the Wowza Preview End User License Agreement. To be considered for preview participation, contact cloud-preview@wowza.com.
  • Wowza CDN on Fastly stream targets are available in Wowza Streaming Cloud REST API version 1.4.

About streaming over Wowza CDN on Fastly


We recommend using Wowza CDN on Fastly stream targets for new stream configurations only, not for updating existing live streams or transcoders. Because Wowza CDN on Fastly is integrated directly with Wowza Streaming Cloud, you don't need a separate CDN provider subscription. 

Usage-based billing for streaming to Wowza CDN on Fastly from Wowza Streaming Cloud is not currently available. We invite preview participants to provide feedback on the feature functionality while testing this configuration free from egress and CDN usage charges.

The following limitations also apply:

  • Security features such as token authorization and geo-blocking aren't currently available
  • Ultra low latency streams aren't compatible with Wowza CDN on Fastly

Create a live stream


If you are enrolled in the private preview, Wowza CDN on Fastly stream targets are automatically included with Wowza Streaming Cloud live streams.

Create a live stream using the Wowza Streaming Cloud REST API live_streams endpoint, and set the target_delivery_protocol to hls-https. The new live stream uses a Wowza CDN on Fastly stream target.

Next, you can Start and stop the stream.

Create a transcoder


To use a Wowza CDN on Fastly stream target with a transcoder, start by configuring the trancoder.

  1.  Using the Wowza Streaming Cloud REST API, create a transcoder and add output renditions. For instructions, see:
  2. Make note of the ID of the transcoder and the ID of each output rendition. You'll need them to assign a Wowza CDN on Fastly stream target to the output renditions of the transcoder.

Create a Wowza CDN on Fastly stream target for the outputs


Next, you'll create the Wowza CDN on Fastly stream target, which is a destination that uses Wowza CDN to deliver the stream to players via Fastly.

Wowza CDN on Fastly stream target parameter

Parameter Data Type Description
name string A descriptive name for the stream target. Maximum 255 characters.

Example request and response

Notes:

Create a Wowza CDN on Fastly stream target:

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_fastly": {
     "name": "My first Wowza CDN on Fastly target"
   } 
}' "${WSC_HOST}/api/${WSC_VERSION}/stream_targets/fastly"

The details of the configured target are listed in the response, which should look something like this:

{
    "stream_target_fastly": {
        "id": "lwzgrj9r",
        "name": "My first Wowza CDN on Fastly target",
        "state": "activated",
        "stream_name": "ZmYxSXRrTERrUlk9",
        "playback_url": "https://[subdomain]/TWhoL3BiZnJXMFhmNzZVN3JrZDAwUT09/hls/live/ZmYxSXRrTERrUlk9/playlist.m3u8",
        "created_at": "2019-05-20T16:38:21.000Z",
        "updated_at": "2019-05-20T16:38:21.000Z"
    }
}

Add the stream target to each output


After creating the Wowza CDN on Fastly stream target, associate it with each output rendition for your transcoder by creating an output stream target object.

Ouput stream target parameters

Parameter Data Type Description
output_id string The unique alphanumeric string that identifies the output rendition. You can find the ID in the details of each of the outputs you just created.
stream_target_id string The unique alphanumeric string that identifies the stream target that will deliver the stream to viewers. You can find the ID in the details of the custom stream target you just created.
transcoder_id string The unique alphanumeric string that identifies the transcoder that will generate the output renditions. You can find the ID in the details of the transcoder you just created.

Example request and response

Assign a stream target to an output:
 
curl -X POST \
-H "Content-Type: application/json" \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
-d '{
   "output_stream_target": {
     "stream_target_id": "lwzgrj9r"
   } 
}' "${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/outputs/[output_id]/output_stream_targets"

The details of the assigned target are listed in the response, which should look something like this:
 
{
   "output_stream_target": {
    "stream_target_id": "lwzgrj9r"
   }
}

Start and stop the stream


Now you can connect the configured live stream or transcoder to the source encoder or camera and test the setup. For more information on setting up a video source for Wowza Streaming Cloud, see Connect a source.

Use the PUT method to start and stop the live stream or transcoder. Wowza Streaming Cloud ingests the stream from the source, creates the passthrough output and the lower-quality transcoded output renditions, and sends all of the outputs to Wowza CDN via Fastly.

Example requests

Start the live stream:
 
curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]/start"

Stop the live stream:
 
curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]/stop"
Start the transcoder:
 
curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/start"

Stop the transcoder:
 
curl -X PUT \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/stop"

Apply advanced properties


Wowza CDN on Fastly stream targets support a subset of advanced properties available for Wowza CDN HLS stream targets and for custom stream targets whose provider is akamai_cupertino. You can use the chunkSize, convertAMFData, and playlistSeconds properties with Wowza CDN on Fastly stream targets. By default, these protocol properties are enabled and configured to use their default values. You can, however, change or customize them. For information, see Set advanced properties with the Wowza Streaming Cloud REST API.

Test playback


For a live stream, if you've enabled a hosted page, use the hosted_page_url in the live stream details to play a test stream. If you don't have a hosted page enabled, use the player_hls_playback_url in the live stream details to configure and play a test stream using an HLS-compatible player such as Wowza™ Player.

For a transcoder, use the playback_url available in the Wowza CDN on Fastly stream target details to configure and play a test stream using an HLS-compatible player such as Wowza Player.

Analyze usage data


Usage data for Wowza CDN on Fastly stream targets updates approximately in or near real-time. You can query for a summary of stream target usage, detailed usage for all stream targets, detailed usage for a single stream target, or the number of real-time viewers of an active stream.

Wowza CDN on Fastly stream target usage query parameters

Parameter Description
from The start of the range of time you want to view. Specify YYYY-MM-DD HH:00:00 where HH is a 24-hour clock in UTC. The range doesn't include hours and minutes, and it rounds minutes up to the hour. The from default is the last billing date.
to The end of the range of time you want to view. Specify YYYY-MM-DD HH:00:00 where HH is a 24-hour clock in UTC. The range doesn't include hours and minutes, and it rounds minutes up to the hour. The to default is the end of the current day.

Example requests

Fetch a summary of stream target usage for the account:

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/stream_targets/summary?from=2019-08-04 15:00:00&to=2019-9-04 15:00:00"

The response provides aggregate account information for all Wowza CDN on Fastly stream targets, including unique viewers, viewing time, and bytes of usage per billing zone.

Fetch usage details for all stream targets in the account:

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/stream_targets?from=2019-08-04 15:00:00&to=2019-9-04 15:00:00"
 
Note: The response is paginated with a default per_page value of 1000. For more information on paginating query results, see Get paginated query results with the Wowza Streaming Cloud REST API.

The response provides detailed information for all Wowza CDN on Fastly stream targets in the account, including the stream target ID, type of target, unique viewers, viewing time, total bytes of usage for the target, and bytes of usage per billing zone.

Fetch usage details for a single stream target:

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/stream_targets/[stream_target_id]?from=2019-08-04 15:00:00&to=2019-9-04 15:00:00"

The response provides detailed information for a single Wowza CDN on Fastly stream target, including the stream target ID, type of target, unique viewers, viewing time, total bytes of usage for the target, and bytes of usage per billing zone.

Fetch usage data per country for a single stream target:

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/stream_targets/[stream_target_id]/countries"

The response provides detailed usage information for the stream target, broken out by country. Details for each country where the stream was requested include the country code, country name, unique viewers, viewing time, total bytes of usage for the target, and bytes of usage per billing zone.

Fetch usage data per rendition for a single stream target:

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/stream_targets/[stream_target_id]/renditions"

The response provides detailed usage information for the stream target, broken out by output rendition. Details for each rendition include the rendition name, unique viewers, viewing time, total bytes of usage for the target, and bytes of usage per billing zone.

Fetch live viewer data for a single stream target:

curl -X GET \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/usage/stream_targets/[stream_target_id]/live"

The response provides the ID for a single Wowza CDN on Fastly stream target and the number of unique viewers for that target within the last 90 seconds.