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

The Wowza Streaming CloudTM service REST API provides URLs that can be used to play streams directly from a transcoder. Playing streams over transcoder's direct playback URL bypasses delivery through stream targets. Direct playback is limited to 100 viewers per transcoder, and you can reduce that to as few as 10 connections.

Content


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

Get direct playback URLs


Notes:

  • For [key], substitute your API key or your access key as appropriate. For more information, see Locating and using API and access keys.
  • For [version], substitute the version number of the API that you're using. For the current version, use v1.2.

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

curl X GET --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" https://api.cloud.wowza.com/api/[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",
   "hls"
   ]

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, including the passthrough rendition. In the response, the playback URLs look something like this:

"direct_playback_urls": {
   "hls": [
      {
          "name": "default",
          "url:" "https://[subdomain].entrypoint.cloud.wowza.com/app-3fa9/ngrp:4a07cfd4_all/playlist.m3u8"
      },
   ],
   "rtmp": [
      {
         "name": "source",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-3fa9/4a07cfd4"
      },
      {
         "name": "passthrough",
         "output_id": "0sxdnnfj",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-3fa9/4a07cfd4_stream1"
      },
      {
         "name": "640x360",
         "output_id": "xcmj9w29",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-3fa9/4a07cfd4_stream2"
      },
      {
         "name": "512x288",
         "output_id": "zyrnc2ng",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-3fa9/4a07cfd4_stream3"
      },
      {
         "name": "320x180",
         "output_id": "kktcb2ld",
         "url": "rtmp://[subdomain].entrypoint.cloud.wowza.com/app-3fa9/4a07cfd4_stream4"
      }
   ],
   "rtsp": [
      {   
         "name": "source",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4"
      },
      {
         "name": "passthrough",
         "output_id": "0sxdnnfj",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream1"
      },
      {
         "name": "640x360",
         "output_id": "xcmj9w29",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream2"
      },
      {
         "name": "512x288",
         "output_id": "zyrnc2ng",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream3"
      },
      {
         "name": "320x180",
         "output_id": "kktcb2ld",
         "url": "rtsp://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream4"
      }
   ],
   "wowz": [
      {
         "name": "source",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4"
      },
      {
         "name": "passthrough",
         "output_id": "0sxdnnfj",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream1"
      },
      {
         "name": "640x360",
         "output_id": "xcmj9w29",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream2"
      },
      {
         "name": "512x288",
         "output_id": "zyrnc2ng",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream3"
      },
      {
         "name": "320x180",
         "output_id": "kktcb2ld",
         "url": "wowz://[subdomain].entrypoint.cloud.wowza.com:1935/app-3fa9/4a07cfd4_stream4"
      }
   ]
}

Note: Direct playback for HLS streams doesn't work over SSL for Android. For Android, use HTTP instead of HTTPS.

Reduce 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 and 100, inclusive. The default is 100.

To specify a number of connections, execute the command:

curl -X PATCH --header "Content-Type: application/json" --header "wsc-api-key: [key]" --header "wsc-access-key: [key]" -d ' {
   "transcoder": {
       "play_maximum_connections": 20
   }
}' https://api.cloud.wowza.com/api/[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"
   }
}