Connect an SRT encoder to Wowza Streaming Cloud using the Wowza Streaming Cloud REST API

The Wowza Streaming Cloud™ service can connect to H.264 or H.265/HEVC encoders that support the Secure Reliable Transport (SRT) protocol. SRT is an open source video transport protocol that is designed to deliver secure, high-quality, low latency live streams over unpredictable network conditions.

Notes:
  • Source authentication and closed captions aren't available for SRT.
  • Wowza Streaming Cloud supports SRT version 1.4.

Create a live stream


The live stream workflow allows you to configure more settings in one API request, while the transcoder workflow allows more modular, custom configuration of settings using multiple API requests. Start with this section if you choose the live stream workflow.

  1. Using the Wowza Streaming Cloud REST API, create a live stream.

    Live stream parameters

    Parameter Data Type Description
    aspect_ratio_height integer

    The height, in pixels, of the output rendition.

    This value should correspond to the aspect ratio (widescreen or standard) of the video source and be divisible by 8. Set the aspect ratio of the live stream to match the aspect ratio in your encoder settings.

    aspect_ratio_width integer

    The width, in pixels, of the output rendition.

    This value should correspond to the aspect ratio (widescreen or standard) of the video source and be divisible by 8. Set the aspect ratio of the live stream to match the aspect ratio in your encoder settings.

    billing_mode string The billing mode for the stream. Specify the default value, pay_as_you_go.
    broadcast_location string The region that's closest to where your stream originates. For a list of valid regions, see the API reference documentation.
    encoder string The video source for the live stream. Specify other_srt.
    name string The name of the live stream. Enter an alphanumeric string that is short (maximum 200 characters) and descriptive, for example, MySRTStream.
    transcoder_type string The type of transcoder. Specify the default value, transcoded. You can alternatively use passthrough, depending on your needs and the functionality available at your broadcast location.
    delivery_method string The method you're using to deliver the source stream to the transcoder. Specify the default value, push. Wowza Streaming Cloud doesn't support pull or cdn connections for SRT.

    For a full list of live stream parameters, see Live Streams in the Wowza Streaming Cloud API reference.

    Example request and response

    Notes:

    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_srt",
         "name": "MySRTStream",
         "transcoder_type": "transcoded"
       }
    }' "${WSC_HOST}/api/${WSC_VERSION}/live_streams"

    This request creates a live stream with an id parameter, an associated player, and a hosted page. The details of the live stream's configuration are listed in the response. For SRT, you'll use the source_connection_information to configure the stream.

    {
       "live_stream": {
         "id": "1234abcd",
         "name": "MySRTStream",
         ...
         "encoder": "other_srt",
         ...
         "source_connection_information": {
           "primary_server": "srt://[subdomain].entrypoint.cloud.wowza.com",
           "host_port": "10000",
           "stream_name": "54g2813p"
           "disable_authentication": "true"
           "username": "null"
           "password": "null"
         },
         ...
       }
    }

    Related API requests

    View the details of a live stream, including the player embed code and hosted page URL:

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

    Update a live stream's configuration:

    curl -X PATCH \
    -H "Content-Type: application/json" \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    -d '{
       "live_stream": {
         "name": "MyDifferentLiveStreamName"
       }
    }' "${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]"

    Delete a live stream:

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

  2. Next, configure the SRT encoder to send the source stream to Wowza Streaming Cloud. To publish a test stream to Wowza Streaming Cloud, see Test the live stream connection.

Configure the source for the live stream


For a hardware encoder, make sure you have the latest firmware installed. See the encoder's user guide for details about how to operate the device or software and how to specify settings such as resolution, bitrate, and frame rate.

Note: When ingesting the stream, Wowza Streaming Cloud functions in SRT listener mode when establishing a handshake with a peer.
  1. Use the primary_server and host_port values returned in the REST API response to configure the SRT encoder.
  2. Refer to documentation for your specific encoder to note where to input the stream settings.

    For example, Address is the primary_server value:
    [wowza_subdomain].entrypoint.cloud.wowza.com

    While Destination Port is the host_port value: 10000

Test the live stream connection


  1. Use the primary_server and host_port from the REST API response to configure the stream settings.
  2. Start the live stream using the Wowza Streaming Cloud REST API.

    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"

    Alternatively, click Start Live Stream at the top of the live stream detail page in the Wowza Streaming Cloud user interface.
  3. If you’re using the Wowza Streaming Cloud REST API to start the live stream, fetch the state of the live stream to make sure it’s started.

    Fetch the state of the live stream:
    curl -X GET \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    "${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]/state"
  4. Confirm that the stream is playing.
     
    1. Fetch a video thumbnail of the stream using the Wowza Streaming Cloud REST API.

      Fetch the thumbnail URL of a live stream:
      curl -X GET \
      -H "wsc-api-key: ${WSC_API_KEY}" \
      -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
      "${WSC_HOST}/api/${WSC_VERSION}/live_streams/[live_stream_id]/thumbnail_url"
    2. View the thumbnail URL in a browser.
    3. Alternatively, in the Wowza Streaming Cloud user interface, confirm that the live stream is playing by looking at the Video Thumbnail in the Overview tab of the live stream detail page.
  5. Use the Wowza Streaming Cloud REST API to stop the live stream.

    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"

    Alternatively, click Stop Live Stream at the top of the live stream detail page in the Wowza Streaming Cloud user interface.

Create a transcoder


  1. Using the Wowza Streaming Cloud REST API, create a transcoder.

    Transcoder parameters

    Parameter Data Type Description
    billing_mode string The billing mode for the stream. Use the default, pay_as_you_go.
    broadcast_location string Specify the region that's closest to where your stream originates. For a list of valid regions, see the API reference documentation.
    delivery_method string The method you're using to deliver the source stream to the transcoder. Specify push. Wowza Streaming Cloud doesn't support pull or cdn connections for SRT.
    name string The name of the transcoder. Enter an alphanumeric string that is short (maximum 200 characters) and descriptive, for example, MySRTTranscoder.
    protocol string The transport protocol you're using to send the encoded stream to the transcoder. Specify srt.
    transcoder_type string Specify the default value, transcoded. You can alternatively use passthrough, depending on your needs and the functionality available at your broadcast location.

    Example request and response

    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",      
        "delivery_method": "push",      
        "name": "MySRTTranscoder",      
        "protocol": "srt",      
        "transcoder_type": "transcoded"
      } 
    }' "${WSC_HOST}/api/${WSC_VERSION}/transcoders"

    This request creates a transcoder with an id parameter, but no outputs or stream targets. The details of the transcoder's configuration are listed in the response, which should look something like this:

    { 
      "transcoder": { 
        "id": "tmd8ybp2", 
        "name": "MySRTTranscoder", 
        "transcoder_type": "transcoded", 
        "billing_mode": "pay_as_you_go", 
        "broadcast_location": "us_west_california", 
        ... 
        "protocol": "srt", 
        "delivery_method": "push", 
        "source_port": 10000, 
        "domain_name": "[hostname].entrypoint.cloud.wowza.com", 
        ...
        "outputs": []
      } 
    } 
  2. Complete the transcoder by adding output renditions and stream targets. For instructions, see one of the following articles, depending on whether you're creating an adaptive bitrate or passthrough transcoder:
     
  3. Next, configure the SRT encoder to send the source stream to Wowza Streaming Cloud. To publish a test stream to Wowza Streaming Cloud, see Test the transcoder connection.

Configure the source for the transcoder


For a hardware encoder, make sure you have the latest firmware installed. See the encoder's user guide for details about how to operate the device or software and how to specify settings such as resolution, bitrate, and frame rate.

Note: When ingesting the stream, Wowza Streaming Cloud functions in SRT listener mode when establishing a handshake with a peer.
  1. Use the domain_name and source_port values returned when you created the transcoder to configure the SRT encoder.
  2. Refer to documentation for your specific encoder to note where to input the stream settings.

    For example, Address is the domain_name value:
    [wowza_subdomain].entrypoint.cloud.wowza.com

    While Destination Port is the source_port value: 10000

Test the transcoder connection


  1. Start the transcoder using the Wowza Streaming Cloud REST API.

    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"


    Alternatively, click Start Transcoder at the top of the transcoder detail page in the Wowza Streaming Cloud user interface.
  2. If you’re using the Wowza Streaming Cloud REST API to start the transcoder, fetch the state of the transcoder to make sure it’s started.

    Fetch the state of the transcoder:
    curl -X GET \
    -H "wsc-api-key: ${WSC_API_KEY}" \
    -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
    "${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/state"
  3. Start the stream in the SRT encoder.
  4. Confirm that the stream is playing.
    1. Fetch a video thumbnail of the stream using the Wowza Streaming Cloud REST API.

      Fetch the thumbnail URL of a transcoder:
      curl -X GET \
      -H "wsc-api-key: ${WSC_API_KEY}" \
      -H "wsc-access-key: ${WSC_ACCESS_KEY}" \
      "${WSC_HOST}/api/${WSC_VERSION}/transcoders/[transcoder_id]/thumbnail_url"
    2. View the thumbnail URL in a browser.
    3. Alternatively, in the Wowza Streaming Cloud user interface, confirm that the transcoder is playing by looking at the Video Thumbnail in the Overview tab of the transcoder detail page.
  5. Use the Wowza Streaming Cloud REST API to stop the transcoder.

    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"


    Alternatively, click Stop Transcoder at the top of the transcoder detail page in the Wowza Streaming Cloud user interface.
  6. Stop the stream in the source camera or SRT encoder.

More resources