Speed up the connection to a transcoder with the Wowza Video REST API

Learn how to use the Wowza Video REST API to speed up the connection between a source encoder and a transcoder. When configuring an encoder to push video to a transcoder in the Wowza VideoTM service, you must enter a host server location, usually a URL, in the encoder settings. After starting the connection between the encoder and the transcoder, there may be a delay of up to 10 seconds while a DNS server looks up the URL of the host server and resolves it to an IP address. You can remove this delay by identifying the IP address of the transcoder's host server and then entering the IP address into your encoder settings directly.

Before you start

You should have completed the following tasks:

  • Create a live stream or either an adaptive bitrate or passthrough transcoder using the push delivery method. You'll need the ID or transcoder ID resulting from that process. View our connect a source topics to learn how to create a live stream or transcoder for RTMP, RTSP, IP camera, SRT encoder, UDP encoder, WebRTC, and Wowza Streaming Engine.

You should have access to the following items:

  • The encoder's user guide for details about how to operate the device or software and how to specify settings.

1. Start the transcoder

The IP address of the transcoder is 0.0.0.0 (local host) until it's started so you'll need to start the transcoder to identify the IP address.

You can use the following sample request, making sure to:

  • Set transcoder_id to the ID returned when you created the live stream or transcoder.

Sample request

Endpoint Reference

Copy
Copied
curl -X PUT \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[transcoder_id]/start"

2. Fetch the IP address of the transcoder's host server

Now you can query the state of the transcoder to return the IP address. You might have to query several times, until the transcoder is in the started state rather than starting.

Sample request

Endpoint Reference

Copy
Copied
curl -X GET \
-H "Authorization: Bearer ${WV_JWT}" \
"${WV_HOST}/api/${WV_VERSION}/transcoders/[transcoder_id]/state"

Sample response

Copy
Copied
{
  "transcoder": {
    "state": "started",
    "uptime_id": "abcwxfxy",
    "ip_address": "17.196.145.176"
  }
}

3. Enter the IP address in the encoder settings

In the encoder settings for configuring the host server, enter the IP address instead of the host server URL. Refer to the documentation for your encoder to note how to access and update its settings.

For example, enter 17.196.145.176 instead of [host_name].entrypoint.video.wowza.com.

If you were configuring OBS as the encoder, you'd format the URL as:

rtmp://17.196.145.176:[host_port]/[application]

Where:

  • [host_port] is the port (by default 1935 )
  • [application] is the application name for the stream assigned by Wowza Video

4. Connect the encoder to the transcoder

Start your camera and source encoder. The encoder connects to the transcoder using the IP address you specified without a delay due to DNS lookup.

Info

Each time the transcoder starts, the IP address is likely to be different. You must update your source encoder settings after each start if you choose to connect using the IP address instead of the host name URL.

More resources