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

The Wowza Streaming CloudTM service REST API provides 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.

Content


Get direct playback URLs
Change the number of direct connections to the transcoder

Get direct playback URLs


Notes:

To get the playback URLs for a transcoder, perform this request:

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]"

The response includes a list of delivery protocols for the transcoder, which looks something like this:

"delivery_protocols": [
   "rtmp",
   "rtsp",
   "wowz",
   "webrtc"
   ]

The response also includes an array of direct playback URLs for the delivery protocols. Each protocol has playback URLs for the source and for each output rendition. In the response, the playback URLs look something like this:

"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"
      }
   ]
}

Change the number of direct connections to the transcoder


You can specify the number of connections allowed to the transcoder by using the play_maximum_connections parameter.

Parameter Data Type Description
play_maximum_connections Integer The number of viewers allowed to connect to a transcoder. Valid values are any integer between 10 (default) and the maximum number the transcoder supports. The maximum viewer limit for the transcoder is displayed in Wowza Streaming Cloud on the Direct Playback URLs tab of the transcoder details page.

To specify a number of connections, execute the command:

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]"

The response should look something like this:

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