Create a VOD stream with the Wowza Streaming Cloud REST API

Learn how to create a video on demand (VOD) stream using the Wowza Streaming Cloud™ REST API.

About VOD streams


A VOD stream is a recording of a live stream that viewers can replay at a later date. VOD streams can be configured through the live stream or transcoder workflow and only work with Fastly stream targets. After the broadcast is over and the live stream or transcoder is stopped, Wowza Streaming Cloud creates the VOD stream and generates a playback URL

Notes:
  • This feature is available in v1.5 of the REST API and later.
  • Wowza Streaming Cloud automatically assigns a name when it creates the VOD stream. The VOD stream name includes the name of the live stream or transcoder and the date and time the live stream was started.
  • VOD streams can't be created from 24x7 streams.

Security

You can disable playback of a VOD stream to prevent viewers from playing a stream. Additional security settings can also be configured to protect the delivery and access to the stream. These settings are configured on the stream target associated with the VOD stream.

With Fastly stream targets, you can require HTTPS for playback, apply geo-block restrictions to allow or block access in certain locations, and encrypt streams using token authentication. For more information, see the following articles:

Note: If you update the security settings for a Fastly stream target, those changes are automatically applied to the VOD streams associated with the target.

Storage

VOD streams stored in Wowza Streaming Cloud generate additional costs. Billing is based on your peak storage, which is the greatest amount of recorded content (VOD streams and recordings) stored in a given month. To help you stay apprised of costs, you can check your peak storage at any time using the Wowza Streaming Cloud REST API. For more information, see View usage data with the Wowza Streaming Cloud REST API.

Note: Wowza Streaming Cloud deletes VOD streams 90 days after an account is suspended or terminated.

Create a VOD stream


Live stream workflow

To create a VOD stream through the live stream workflow, set the vod_stream parameter to true:

Example requests

Create a live stream:

    curl -X POST \
    -H "Content-Type: application/json" \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    -d '{
       "live_stream": {
         "aspect_ratio_height": 720,
         "aspect_ratio_width": 1280,
         "billing_mode": "pay_as_you_go",
         "broadcast_location": "us_west_california",
         "delivery_method": "push",
         "encoder": "other_rtmp",
         "name": "MyVODLiveStream",
         "transcoder_type": "transcoded",
         "vod_stream": true
       }
    }' "${WSC_HOST}/api/${WSC_VERSION}/live_streams"

This command creates a live stream with an id parameter, automatically adds output renditions, and assigns each rendition a Fastly stream target.

Transcoder workflow

To create a VOD stream through the transcoder workflow, enable the transcoder property for VOD streams.

Section Key Value Description
vod_stream hls boolean If true creates a VOD stream after the live stream broadcast is over. The default is false.

Example request

Create a transcoder:

    curl -X POST \
    -H "Content-Type: application/json" \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    -d '{
       "transcoder": {
         "billing_mode": "pay_as_you_go",
         "broadcast_location": "us_west_california",
         "buffer_size": 4000,
         "delivery_method": "push",
         "low_latency": true,
         "name": "MyVODTranscoder",
         "protocol": "rtsp",
         "transcoder_type": "transcoded",
         "properties": {
            "key": "hls",
            "section": "vod_stream",
            "value": true
          }
       }
    }' "${WSC_HOST}/api/${WSC_VERSION}/transcoders"

This command creates a transcoder with an id parameter but no outputs. Next, complete the transcoder by adding output renditions, and then assign a Fastly stream target to each rendition. For more information, see the following articles:

Related requests

View VOD stream details:

    curl -X GET \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    "${WSC_HOST}/api/${WSC_VERSION}/vod_streams/[vod_stream_id]"

This request returns details for a single VOD stream, including the playback_url, which can be used to play a VOD stream in an HLS compatible player or device.

{
    "vod_stream": {
        "id": "la2prpfc",
        "state": "completed",
        "type": "Original",
        "name": "VOD stream 1",
        "stream_target_id": "khppwdjb",
        "playback_enabled": true,
        "playback_url": "https:[wowzasubdomain].wowza.com/2/PKtmdHdsw3t4Z2qL/ZMBkWq9I/hls/aw5mrjcc/playlist.m3u8",
        "started_at": "2020-02-21T15:32:36.000Z",
        "size": 1420631212,
        "duration": 4589,
        "start_segment": 1,
        "end_segment": 2307,
        "source": live,
        "percent_complete": 100.0,
        "uptime_id": "abcd1234",
        "updated_at": "2020-02-21T17:24:08.000Z",
        "created_at": "2020-02-21T15:32:35.000Z"
    }
}
    

Update a VOD stream:

    curl -X PATCH \
    -H "Content-Type: application/json" \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    -d '{
       "vod_stream": {
         "name": "MyDifferentVODStreamName",
         "playback_enabled": false
       }
    }' "${WSC_HOST}/api/${WSC_VERSION}/vod_streams/[vod_stream_id]"

This request updates the VOD stream name and playback_enabled parameter.

Delete a VOD stream:

    curl -X DELETE \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    "${WSC_HOST}/api/${WSC_VERSION}/vod_streams/[vod_stream_id]"

Disable VOD stream playback


VOD stream playback is enabled by default. To prevent viewers from playing a VOD stream, set the playback_enabled parameter to false.

    curl -X PATCH \
    -H "Content-Type: application/json" \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    -d '{
       "vod_stream": {
         "playback_enabled": false
       }
    }' "${WSC_HOST}/api/${WSC_VERSION}/vod_streams/[vod_stream_id]"

More resources