Play streams directly from a transcoder with the Wowza Streaming Cloud REST API

The Wowza Streaming CloudTM service REST API provides URLs you can use to deliver live streams to viewers or other video services directly from the transcoder, bypassing standard stream delivery through a CDN. You might choose to stream directly through the transcoder to reduce latency or to use a protocol not offered through a CDN. Direct playback URLs are often used to stream to services like Facebook, LinkedIn, Twitter, and others.

When choosing to deliver your stream directly from a transcoder, consider the following feature details:

  • Protocols supported – Direct playback URLs are available for RTMP, RTSP, WOWZ, and WebRTC.
  • Cost – Egress costs for direct playback are typically greater than the costs associated with delivering streams to viewers through a CDN. For more information, see the terms of your Cloud subscription for details on the associated costs.
  • Maximum viewer connections – By default, direct playback is limited to 10 viewers. You can change the default value to allow additional viewers. The maximum number of viewers a transcoder can support varies depending on configuration options you selected when you set up the transcoder. Generally, adaptive bitrate transcoders are larger and support more viewer connections (up to 300) while passthrough transcoders are smaller and support fewer viewer connections. Make sure you do sufficient testing to ensure your streaming goals are met.

Before you start


You should be familiar with the following concepts:

  • API authentication method. Use HMAC authentication for production environments. For testing or proof of concept purposes only, use API key and access key authentication.
  • Environment variables for the API version and your API and access keys in the cURL API request examples in this topic to make it easier for you to copy, paste, and run commands in your Terminal or Command Prompt window. If you don't set environment variables for these values, you'll need to manually enter the correct values in the code samples throughout this tutorial. See Tools for testing the API for instructions.

1. Get direct playback URLs


To get the playback URLs for a transcoder, you can use the following sample request, making sure to:

  • Set the transcoder_id in the request url.

Sample request

Endpoint Reference

curl X GET \
-H "Content-Type: application/json" \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
"${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]"

Sample response

The response includes:

  • A list of protocols for the transcoder
  • An array of direct_playback_urls for the delivery protocols. Each protocol has playback URLs for the source and for each output rendition.
"delivery_protocols": [
   "rtmp",
   "rtsp",
   "wowz",
   "webrtc"
   ]


"direct_playback_urls": {
   "rtmp": [
      {
         "name": "source",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-B8P6K226/4a07cfd4"
      },
      {
         "name": "webrtc",
         "output_id": "0sxdnnfj",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-B8P6K226/4a07cfd4_stream1"
      },
      {
         "name": "V:1280x720+A:128K",
         "output_id": "vz5qfxqt",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-B8P6K226/4a07cfd4_stream2"
      },
      {
         "name": "V:854x480+A:128K",
         "output_id": "yypdk9rj",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-B8P6K226/4a07cfd4_stream3"
      },
      {
         "name": "V:640x360+A:128K",
         "output_id": "xcmj9w29",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-B8P6K226/4a07cfd4_stream4"
      },
      {
         "name": "V:512x288+A:128K",
         "output_id": "zyrnc2ng",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-B8P6K226/4a07cfd4_stream5"
      },
      {
         "name": "V:320x180+A:128K",
         "output_id": "kktcb2ld",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-B8P6K226/4a07cfd4_stream6"
      }
   ],
   "rtsp": [
      {   
         "name": "source",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4"
      },
      {
         "name": "webrtc",
         "output_id": "0sxdnnfj",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream1"
      },
      {
         "name": "V:1280x720+A:128K",
         "output_id": "vz5qfxqt",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream2"
      },
      {
         "name": "V:854x480+A:128K",
         "output_id": "yypdk9rj",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream3"
      },
      {
         "name": "V:640x360+A:128K",
         "output_id": "xcmj9w29",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream4"
      },
      {
         "name": "V:512x288+A:128K",
         "output_id": "zyrnc2ng",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream5"
      },
      {
         "name": "V:320x180+A:128K",
         "output_id": "kktcb2ld",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream6"
      }
   ],
   "wowz": [
      {
         "name": "source",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4"
      },
      {
         "name": "webrtc",
         "output_id": "0sxdnnfj",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream1"
      },
      {
         "name": "V:1280x720+A:128K",
         "output_id": "vz5qfxqt",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream2"
      },
      {
         "name": "V:854x480+A:128K",
         "output_id": "bff5jwyv",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream3"
      },
      {
         "name": "V:640x360+A:128K",
         "output_id": "xcmj9w29",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream4"
      },
      {
         "name": "V:512x288+A:128K",
         "output_id": "zyrnc2ng",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream5"
      },
      {
         "name": "V:320x180+A:128K",
         "output_id": "kktcb2ld",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-B8P6K226/4a07cfd4_stream6"
      }
   ]
   "webrtc": [
      {
         "name": "source",
         "url": "wss://[subdomain].entrypoint.cloud.wowza.com/webrtc-session.json"
      },
      {
         "name": "webrtc",
         "output_id": "qw2p61nn",
         "url": "wss://[subdomain].entrypoint.cloud.wowza.com/webrtc-session.json",
         "application_name": "app-B8P6K226",
         "stream_name": "b19b3a52_stream1"
      },
      {
         "name": "V:1280x720+A:128K",
         "output_id": "vz5qfxqt",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/webrtc-session.json"
         "application_name": "app-B8P6K226",
         "stream_name": "b19b3a52_stream2"
      },
      {
         "name": "V:854x480+A:128K",
         "output_id": "vj8mkthg",
         "url": "wss://[subdomain].entrypoint.cloud.wowza.com/webrtc-session.json",
         "application_name": "app-B8P6K226",
         "stream_name": "b19b3a52_stream3"
      },
      {
         "name": "V:640x360+A:128K",
         "output_id": "7glwfzpf",
         "url": "wss://[subdomain].entrypoint.cloud.wowza.com/webrtc-session.json",
         "application_name": "app-B8P6K226",
         "stream_name": "b19b3a52_stream4"
      },
      {
         "name": "V:512x288+A:128K",
         "output_id": "0w3fpbb2",
         "url": "wss://[subdomain].entrypoint.cloud.wowza.com/webrtc-session.json",
         "application_name": "app-B8P6K226",
         "stream_name": "b19b3a52_stream5"
      },
      {
         "name": "V:320x180+A:128K",
         "output_id": "vv1jrzbz",
         "url": "wss://[subdomain].entrypoint.cloud.wowza.com/webrtc-session.json",
         "application_name": "app-B8P6K226",
         "stream_name": "b19b3a52_stream6"
      }
   ]
}

2. Change the number of direct connections to the transcoder


To specify the number of connections allowed to the transcoder, you can use the following sample request, making sure to:

  • Set the play_maximum_connections in the request url to a valid value between 10 and the maximum number of viewers the transcoder supports. 

Sample request

Endpoint Reference

curl -X PATCH \
-H "Content-Type: application/json" \
-H "wsc-api-key: ${WSC_API_KEY}" \
-H "wsc-access-key: ${WSC_ACCESS_KEY}" \
-d '{
   "transcoder": {
       "play_maximum_connections": 20
   }
}' "${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]"

Sample response

{
   "transcoder": {
       "created_at": "2017-10-25T11:53:28.508",
       "id": "1234abcd",
       "play_maximum_connections": 20,
       "updated_at": "2017-10-25T11:53:28.508"
   }
}