Transcoders

A transcoder reads media from a source bucket path and writes the converted output (DASH and/or HLS, in SD, HD and/or FHD) to a destination bucket path. Every transcoder belongs to a cloud_s3_transcoder subscription — the subscriptionId comes from the Create Subscription response (see Subscriptions). Source and destination buckets are Storage buckets.

All requests go to the Transcoder gateway and need the authentication headers.

Create Transcoder

Mutation · s3_createTranscoder

Creates a transcoder.

Arguments

NameTypeRequiredDescription
subscriptionIdStringYesThe ID of the subscription, from the Create Subscription response
inputs3_CreateTranscoderInputYesThe payload for creating a transcoder

input

FieldTypeRequiredDescription
transcoderNameStringYesThe name of the transcoder
resolution[s3_Resolution]YesThe output resolutions: SD | HD | FHD
format[s3_StreamFormat]YesThe output formats: DASH | HLS
desBucketIdStringYesThe destination bucket ID of the transcoder
destinationStringYesThe destination path of the transcoder
callBackURLStringNoThe callback URL of the transcoder
bucketIdStringYesThe source bucket ID of the transcoder
bucketSourcePath[String]YesThe list of source paths in the bucket
accessTokenStringNoThe access token of the transcoder
deleteSourceBooleanNoWhether to delete the source file after transcoding

Variables

{
  "subscriptionId": "68e72a206055280790ae2b4d",
  "input": {
    "transcoderName": "transcoder-12",
    "accessToken": null,
    "callBackURL": null,
    "bucketId": "68b9351d95147fc6a5d3c254",
    "bucketSourcePath": ["/video"],
    "destination": "/folder",
    "resolution": ["HD"],
    "format": ["DASH"],
    "deleteSource": false,
    "desBucketId": "68b9351d95147fc6a5d3c254"
  }
}

Request

mutation S3_createTranscoder($subscriptionId: String!, $input: s3_CreateTranscoderInput!) {
  s3_createTranscoder(subscriptionId: $subscriptionId, input: $input) {
    id
    subscriptionId
    mysabayUserId
    transcoderName
    accessToken
    callbackURL
    destination
    bucketSourcePath
    format
    resolution
    deleteSource
    createdAt
    updatedAt
    bucket {
      id
      name
    }
  }
}

Response

Captured sample; createdAt and updatedAt (Float, epoch ms) are not shown.

{
  "data": {
    "s3_createTranscoder": {
      "id": "68e73aa0c2e8b3c3e2919f8f",
      "subscriptionId": "68e72a206055280790ae2b4d",
      "mysabayUserId": 39675494,
      "transcoderName": "transcoder-12",
      "accessToken": null,
      "callbackURL": null,
      "deleteSource": false,
      "bucket": {
        "id": "68b9351d95147fc6a5d3c254",
        "name": "bucket-demo3",
        "__typename": "s3_ShortBucketResponse"
      },
      "destination": "bucket-demo3/folder",
      "format": ["DASH"],
      "resolution": ["HD"],
      "bucketSourcePath": ["/video"]
    }
  }
}

List Transcoders

Query · s3_listTranscoder

Returns the transcoders of a subscription, with pagination.

Arguments

NameTypeRequiredDescription
subscriptionIdStringYesThe ID of the subscription, from the Create Subscription response
pagers3_PagerInputNoPagination

pager

FieldTypeRequiredDescription
pageIntYesThe current page number
limitIntYesThe number of transcoders per page

Variables

{
  "subscriptionId": "674eb7c68078d0a8fd80e8d3",
  "pager": {
    "page": 1,
    "limit": 100
  }
}

Request

query S3_listTranscoder($subscriptionId: String!, $pager: s3_PagerInput) {
  s3_listTranscoder(subscriptionId: $subscriptionId, pager: $pager) {
    transcoders {
      id
      subscriptionId
      mysabayUserId
      transcoderName
      accessToken
      callbackURL
      destination
      bucketSourcePath
      format
      resolution
      deleteSource
      createdAt
      updatedAt
      bucket {
        id
        name
      }
    }
    pagination {
      currentPage
      lastPage
      from
      perPage
      to
      total
    }
  }
}

Response

Captured sample; createdAt / updatedAt (Float, epoch ms) and pagination (s3_Pagination: currentPage, lastPage, from, perPage, to, total — all Int) are not shown.

{
  "data": {
    "s3_listTranscoder": {
      "transcoders": [
        {
          "id": "68e73aa0c2e8b3c3e2919f8f",
          "subscriptionId": "68e72a206055280790ae2b4d",
          "mysabayUserId": 39675494,
          "transcoderName": "transcoder-12",
          "accessToken": null,
          "callbackURL": null,
          "destination": "bucket-demo3/folder",
          "bucketSourcePath": ["/video"],
          "format": ["DASH"],
          "resolution": ["HD"],
          "deleteSource": false,
          "bucket": {
            "id": "68b9351d95147fc6a5d3c254",
            "name": "bucket-demo3"
          }
        }
      ]
    }
  }
}

Get Transcoder

Query · s3_getTranscoderById

Returns a single transcoder.

Arguments

NameTypeRequiredDescription
transcoderIdStringYesThe ID of the transcoder

Variables

{
  "transcoderId": "68e73aa0c2e8b3c3e2919f8f"
}

Request

query S3_getTranscoderById($transcoderId: String!) {
  s3_getTranscoderById(transcoderId: $transcoderId) {
    id
    subscriptionId
    mysabayUserId
    transcoderName
    accessToken
    callbackURL
    destination
    bucketSourcePath
    format
    resolution
    deleteSource
    bucket {
      id
      name
    }
  }
}

Response

{
  "data": {
    "s3_getTranscoderById": {
      "id": "68e73aa0c2e8b3c3e2919f8f",
      "subscriptionId": "68e72a206055280790ae2b4d",
      "mysabayUserId": 39675494,
      "transcoderName": "transcoder-12",
      "accessToken": null,
      "callbackURL": null,
      "destination": "bucket-demo3/folder",
      "bucketSourcePath": ["/video"],
      "format": ["DASH"],
      "resolution": ["HD"],
      "deleteSource": false,
      "bucket": {
        "id": "68b9351d95147fc6a5d3c254",
        "name": "bucket-demo3"
      }
    }
  }
}

Get Transcoder by Bucket

Query · s3_getTranscoderByBucket

Returns the transcoder for a bucket.

Arguments

NameTypeRequiredDescription
bucketNameStringYes
mysabayUserIdIntYes

Variables

{
  "bucketName": "string",
  "mysabayUserId": 0
}

Request

query S3_getTranscoderByBucket($bucketName: String!, $mysabayUserId: Int!) {
  s3_getTranscoderByBucket(bucketName: $bucketName, mysabayUserId: $mysabayUserId) {
    id
    subscriptionId
    mysabayUserId
    transcoderName
    accessToken
    callbackURL
    destination
    bucketSourcePath
    format
    resolution
    deleteSource
    createdAt
    updatedAt
    bucket {
      id
      name
    }
  }
}

Response

{
  "data": {
    "s3_getTranscoderByBucket": {
      "id": "ID",
      "subscriptionId": "String",
      "mysabayUserId": "Float",
      "transcoderName": "String",
      "accessToken": "String",
      "callbackURL": "String",
      "destination": "String",
      "bucketSourcePath": ["String"],
      "format": ["DASH | HLS"],
      "resolution": ["SD | HD | FHD"],
      "deleteSource": "Boolean",
      "createdAt": "Float",
      "updatedAt": "Float",
      "bucket": {
        "id": "ID",
        "name": "String"
      }
    }
  }
}

Update Transcoder

Mutation · s3_updateTranscoder

Updates a transcoder.

Arguments

NameTypeRequiredDescription
subscriptionIdStringYesThe ID of the subscription, from the Create Subscription response
inputs3_UpdateTranscoderInputYesThe updated transcoder

input

FieldTypeRequiredDescription
transcoderIdStringYesThe ID of the transcoder
transcoderNameStringYesThe name of the transcoder
resolution[s3_Resolution]YesThe output resolutions: SD | HD | FHD
format[s3_StreamFormat]YesThe output formats: DASH | HLS
desBucketIdStringYesThe destination bucket ID of the transcoder
destinationStringYesThe destination path of the transcoder
callBackURLStringNoThe callback URL of the transcoder (response field is callbackURL)
bucketSourcePath[String]YesThe list of source paths in the bucket
bucketIdStringYesThe source bucket ID of the transcoder
accessTokenStringNoThe access token of the transcoder
deleteSourceBooleanNoWhether to delete the source file after transcoding

Variables

{
  "subscriptionId": "68e72a206055280790ae2b4d",
  "input": {
    "transcoderId": "68e73aa0c2e8b3c3e2919f8f",
    "transcoderName": "transcoder-12",
    "accessToken": null,
    "callBackURL": null,
    "bucketId": "68b9351d95147fc6a5d3c254",
    "bucketSourcePath": ["/video"],
    "destination": "/folder",
    "resolution": ["HD"],
    "format": ["DASH"],
    "deleteSource": false,
    "desBucketId": "68b9351d95147fc6a5d3c254"
  }
}

Request

mutation S3_updateTranscoder($subscriptionId: String!, $input: s3_UpdateTranscoderInput!) {
  s3_updateTranscoder(subscriptionId: $subscriptionId, input: $input) {
    id
    subscriptionId
    mysabayUserId
    transcoderName
    accessToken
    callbackURL
    destination
    bucketSourcePath
    format
    resolution
    deleteSource
    createdAt
    updatedAt
    bucket {
      id
      name
    }
  }
}

Response

{
  "data": {
    "s3_updateTranscoder": {
      "id": "68e74001c2e8b3c3e291a206",
      "subscriptionId": "68e72a206055280790ae2b4d",
      "mysabayUserId": 39675494,
      "transcoderName": "transcoder",
      "accessToken": null,
      "callbackURL": null,
      "destination": "bucket-demo3/folder",
      "bucketSourcePath": ["/"],
      "format": ["DASH"],
      "resolution": ["HD"],
      "deleteSource": false,
      "createdAt": 1759985665991,
      "updatedAt": 1760413371529,
      "bucket": {
        "id": "68b9351d95147fc6a5d3c254",
        "name": "bucket-demo3"
      }
    }
  }
}

Remove Transcoder

Mutation · s3_deleteTranscoderById

Removes a transcoder.

Arguments

NameTypeRequiredDescription
subscriptionIdStringYesThe ID of the subscription, from the Create Subscription response
inputs3_DeleteTranscoderInputYesThe transcoder to remove

input

FieldTypeRequiredDescription
transcoderIdStringYesThe ID of the transcoder

Variables

{
  "subscriptionId": "68e72a206055280790ae2b4d",
  "input": {
    "transcoderId": "68e74001c2e8b3c3e291a206"
  }
}

Request

mutation s3DeleteTranscodeById($subscriptionId: String!, $input: s3_DeleteTranscoderInput!) {
  s3_deleteTranscoderById(subscriptionId: $subscriptionId, input: $input) {
    message
    success
  }
}

Response

{
  "data": {
    "s3_deleteTranscoderById": {
      "message": "Transcoder delete successfully",
      "success": true
    }
  }
}