> ## Documentation Index
> Fetch the complete documentation index at: https://red5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable Adaptive Bitrate Transcoding in Red5 Cloud

> Enable ABR transcoding in Red5 Cloud by provisioning a Transcoder via the Stream Manager API and publishing to the correct stream name variant.

Transcoding converts a single incoming stream into multiple quality variants — different resolutions and bitrates — simultaneously. Viewers receive the variant that best matches their current network conditions and device capabilities, a delivery model called adaptive bitrate streaming (ABR). Instead of every viewer watching the same fixed-quality stream, playback automatically shifts up or down in quality as bandwidth changes.

<Info>
  Transcoding is available on **Startup, Growth, and Enterprise** plans only. Ensure your deployment has transcoding enabled in the region settings before following the steps below.
</Info>

## Requirements

Before you begin, confirm the following:

* Your account is on a Startup, Growth, or Enterprise plan.
* The deployment you want to use has **Transcoding enabled** in its region configuration (see [Deployments](/red5-cloud/users-guide/deployments) for how to enable it).
* You have your **Stream Manager URL** and **admin credentials** from the Dev Resources page in the [Management Console](https://cloud.red5.net) — you need these to generate a JWT.

## Provision transcoding

Transcoding must be provisioned through the Stream Manager API **before** you start your stream. Provisioning creates the transcoding profile that tells the Transcoder what output variants to produce.

<Steps>
  <Step title="Get a JWT from the Stream Manager">
    Exchange your admin credentials for a JSON Web Token by calling the Stream Manager auth API. You will include this token as a `Bearer` token in your provision request.
  </Step>

  <Step title="Find your nodeGroup name">
    Your **nodeGroup name** is the same as your **Deployment Name** shown on the Deployments page in the Management Console.
  </Step>

  <Step title="Send the Provision POST request">
    Send a `POST` request to the Stream Manager provision endpoint. The example below creates a provision for a stream named `myStream` with three ABR variants.

    ```bash theme={null}
    curl -X POST \
      "https://<stream-manager-host>/as/v1/streams/provision" \
      -H "Authorization: Bearer <your-jwt-token>" \
      -H "Content-Type: application/json" \
      -d '{
        "nodeGroup": "<your-deployment-name>",
        "streamName": "myStream",
        "streams": [
          {
            "streamName": "myStream_1",
            "type": "TranscoderOrigin"
          },
          {
            "streamName": "myStream_2",
            "videoWidth": 1280,
            "videoHeight": 720,
            "videoBitrate": 2500,
            "audioBitrate": 128
          },
          {
            "streamName": "myStream_3",
            "videoWidth": 854,
            "videoHeight": 480,
            "videoBitrate": 1000,
            "audioBitrate": 128
          },
          {
            "streamName": "myStream_4",
            "videoWidth": 640,
            "videoHeight": 360,
            "videoBitrate": 500,
            "audioBitrate": 64
          }
        ]
      }'
    ```

    Replace `<stream-manager-host>`, `<your-jwt-token>`, and `<your-deployment-name>` with your actual values.

    <Note>
      The `_1` variant (e.g., `myStream_1`) is the highest-quality level and is the one your encoder publishes directly to the Transcoder. The Transcoder produces all other variants automatically.
    </Note>
  </Step>

  <Step title="Request a Transcoder IP address">
    Call the Stream Manager's **get server for publish** endpoint with the `transcode=true` query parameter. This returns the IP address of an available Transcoder node. The Stream Manager also automatically selects an appropriate Origin node and updates your provision to route transcoded streams there.

    ```bash theme={null}
    curl -X GET \
      "https://<stream-manager-host>/as/v1/streams/stream?nodeGroup=<your-deployment-name>&streamName=myStream_1&transcode=true" \
      -H "Authorization: Bearer <your-jwt-token>"
    ```

    The response includes a `serverAddress` field — this is the IP address you will point your encoder at.

    ```json theme={null}
    {
      "serverAddress": "203.0.113.42",
      "scope": "live",
      "name": "myStream_1"
    }
    ```
  </Step>

  <Step title="Configure your encoder and start the stream">
    Point your encoder at the Transcoder IP address returned in the previous step. Use `myStream_1` as the stream name (or whatever `_1` variant name you defined in your provision).

    **RTMP example:**

    ```text theme={null}
    Server:     rtmp://203.0.113.42/live
    Stream Key: myStream_1
    ```

    Start your stream. The Transcoder processes the incoming `myStream_1` feed and publishes the other variants (`myStream_2`, `myStream_3`, `myStream_4`) to the Origin node automatically.
  </Step>
</Steps>

## Stream naming convention

When working with Transcoder nodes, always use the `_1` suffix for the stream you publish from your encoder. The Transcoder derives the other variants from the provision you created.

| Stream name  | Role                                        |
| ------------ | ------------------------------------------- |
| `myStream_1` | Published by your encoder to the Transcoder |
| `myStream_2` | Generated by the Transcoder (e.g., 720p)    |
| `myStream_3` | Generated by the Transcoder (e.g., 480p)    |
| `myStream_4` | Generated by the Transcoder (e.g., 360p)    |

<Tip>
  ABR-capable players (such as HLS or DASH players) automatically select the best variant for each viewer. Viewers using the embedded player provided in Pub/Sub Details benefit from ABR without any additional configuration.
</Tip>
