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

The Wowza Streaming Cloud™ service can connect to any H.264 encoder that supports the Secure Reliable Transport (SRT) protocol. SRT enables the delivery of high-quality, low-latency video across the public Internet over unpredictable network conditions. This article describes how to use the Wowza Streaming Cloud REST API to create a transcoder and configure an SRT encoder as the video source.

Note: Wowza Streaming Cloud supports SRT version 1.1.

To set up an SRT encoder for ingest into Wowza Streaming Cloud, you will:

  • Create a transcoder that's configured to accept a source via the SRT protocol
  • Complete the transcoder by adding output renditions and stream targets
  • Configure the source encoder with connection details from Wowza Streaming Cloud

Create a transcoder


  1. Using the Wowza Streaming Cloud REST API, create a transcoder.
     
    Notes:
    • Wowza Streaming Cloud accepts SRT source streams through the transcoder workflow only. You can't configure SRT ingest directly through the live stream workflow.
    • Source authentication is not available for transcoders ingesting SRT streams.

    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. Use push so the SRT source pushes the stream to Wowza Streaming Cloud.
    SRT source streams can't connect to the transcoder using a delivery_method of pull.
    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. Use srt.
    transcoder_type string Specify the default, 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 source encoder. See Configure the source for next steps.

Configure the source


Next configure the SRT encoder to send the source stream to Wowza Streaming Cloud.

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.

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