Update a cloud transcoding task

Updated

Updates an existing Cloud Transcoding task.

PATCH
https://api.sd-rtn.com/v1/projects/{appId}/rtsc/cloud-transcoder/tasks/{taskId}

Use this endpoint to Update a Cloud Transcoding task.

Path Parameters

appIdstring
Required

The App ID of your project from Agora Console.

taskIdstring
Required

The transcoding task UUID used to identify the cloud transcoder for this request.

Query Parameters

builderTokenstring
Required

The tokenName you obtained in the response body of the Acquire method. See Acquire a builder token.

sequenceIdstring
Required

The sequence number of the Update request. Each subsequent Update request must use a value greater than the previous one. A value equal to or lower than the current one is rejected with a 400 error.

updateMaskstring
Required

Specifies the configuration item to be updated. Set it to services.cloudTranscoder.config to indicate a full update.

Header Parameters

Content-Typestring
Required

The request content type. Use application/json.

X-Request-IDstring

UUID (Universally Unique Identifier), used to identify this request.

If the request fails, print out the value in the log to troubleshoot the problem. If the response status code of the request is not 2XX, then the response header may not contain this field.

Request

  • When updating a cloud transcoder, the request body must contain all the fields from the Create request in the request body. For fields that you do not need to update, use the original values. See Updatable fields for the Cloud Transcoding parameters you can modify.

Request Body

servicesobject
Required
cloudTranscoderobject
Required

Response

  • If the returned status code is 200, the request was successful. The response body contains the updated task.

  • If the returned status code is not 200, the request failed.

  • If the request fails, use the X-Request-ID value in the log to troubleshoot the problem. If the response status code is not 2XX, then the response header may not contain this field.

Response Body

The request succeeded and returned task information. sequenceId is the value you passed, and services.cloudTranscoder.config contains the updated configuration.

Response Headers

X-Request-IDstring

The unique request ID. If the request fails, use this value in the log to troubleshoot the problem.

taskIdstring

A UUID used to identify the cloud transcoder for this request operation.

createTsnumber

Unix timestamp (seconds) when the transcoding task was created.

statusstring

The running status of the transcoding task:

  • "IDLE": Task not started.
  • "PREPARED": The task has received a start request.
  • "STARTING": The task is starting.
  • "CREATED": Task initialization completed.
  • "STARTED": The task has started.
  • "IN_PROGRESS": Task in progress.
  • "STOPPING": The task is stopping.
  • "STOPPED": The task has stopped.
  • "EXIT": The task exited normally.
  • "FAILURE_STOP": The task exited abnormally.
sequenceIdstring

The sequence ID.

servicesobject
eventHandlersobject
executionobject
propertiesobject
variablesobject
workflowsobject

Reference

The Update request supports modifying the following fields only:

  • Add or delete rtc members in audioInputs[] and videoInputs[] to subscribe or unsubscribe from the host's audio and video streams.
  • Modify the region field in videoInputs[] to update the host's combined picture layout.
  • Modify the audioOption and videoOption fields in outputs[] to update the transcoding output audio and video configurations.

Response

See Updatable fields for the Cloud Transcoding parameters you can modify.

Authorization

This endpoint requires authentication.

Request examples

# Use a sequenceId greater than the previous update request.# Send the full configuration; keep unchanged fields at their original values.curl --request PATCH \        --url 'https://api.sd-rtn.com/v1/projects/<app_id>/rtsc/cloud-transcoder/tasks/<task_id>?builderToken=<builder_token>&sequenceId=1&updateMask=services.cloudTranscoder.config' \        --header 'Authorization: Basic <credentials>' \        --header 'Content-Type: application/json' \        --data '      {        "services": {          "cloudTranscoder": {            "serviceType": "cloudTranscoderV2",            "config": {              "transcoder": {                "idleTimeout": 300,                "audioInputs": [                  {                    "rtc": {                      "rtcChannel": "test01",                      "rtcUid": 123,                      "rtcToken": "aab8b8f5a8cd4469a63042fcfafe7***"                    }                  },                  {                    "rtc": {                      "rtcChannel": "test01",                      "rtcUid": 456,                      "rtcToken": "aab8b8f5a8cd4469a63042fcfafe7***"                    }                  }                ],                "canvas": {                  "width": 960,                  "height": 480,                  "color": 0,                  "backgroundImage": "https://example.jpg",                  "fillMode": "FIT"                },                "waterMarks": [                  {                    "imageUrl": "https://example.png",                    "region": {                      "x": 0,                      "y": 0,                      "width": 120,                      "height": 120,                      "zOrder": 50                    }                  }                ],                "videoInputs": [                  {                    "rtc": {                      "rtcChannel": "test01",                      "rtcUid": 123,                      "rtcToken": "aab8b8f5a8cd4469a63042fcfafe7***"                    },                    "placeholderImageUrl": "https://example.jpg",                    "region": {                      "x": 0,                      "y": 0,                      "width": 320,                      "height": 360,                      "zOrder": 2                    }                  },                  {                    "rtc": {                      "rtcChannel": "test01",                      "rtcUid": 456,                      "rtcToken": "aab8b8f5a8cd4469a63042fcfafe7***"                    },                    "placeholderImageUrl": "https://example.jpg",                    "region": {                      "x": 320,                      "y": 0,                      "width": 320,                      "height": 320,                      "zOrder": 2                    }                  }                ],                "outputs": [                  {                    "rtc": {                      "rtcChannel": "test",                      "rtcUid": 1000,                      "rtcToken": "aab8b8f5a8cd4469a63042fcfafe7***"                    },                    "audioOption": {                      "profileType": "AUDIO_PROFILE_MUSIC_STANDARD"                    },                    "videoOption": {                      "fps": 30,                      "codec": "H264",                      "bitrate": 800,                      "width": 960,                      "height": 480,                      "lowBitrateHighQuality": false                    }                  }                ]              }            }          }        }      }'

Response example

Example Response
{  "createTs": 1661324613,  "eventHandlers": {},  "execution": {    "workflows": {}  },  "properties": {},  "sequenceId": "1",  "services": {    "cloudTranscoder": {      "config": {},      "createTs": 1661324614,      "details": {},      "message": "",      "serviceType": "cloudTranscoderV2",      "status": "serviceInProgress"    }  },  "status": "IN_PROGRESS",  "taskId": "609f28f2644f1ae1ceb041b7047e3***",  "variables": {},  "workflows": {}}