SubmitMediaConvertJob

更新时间:
复制 MD 格式

Submit a media processing job

Operation description

This is an asynchronous API. After you submit a task, the API returns a task ID and queues the task for asynchronous processing. You will receive the final result via a callback notification, or you can poll for the task status by calling the Query Media Transcoding Task operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ice:SubmitMediaConvertJob

none

*All Resource

*

None None

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

ClientToken

string

No

A unique client token that ensures request idempotency.

86f8e525-9d73-4dac-88aa-7aa4e950c00a

Config

string

Yes

The transcoding job configuration. For more information, see MediaConvertJobConfig.

{ "Inputs": [ { "InputFile": { "Type": "OSS", "Media": "http://**.oss-cn-shanghai.aliyuncs.com/input/**/60min.mp4" } } ], "OutputGroups": [ { "GroupConfig": { "Type": "File", "OutputFileBase": { "Type": "OSS", "Media": "http://**.oss-cn-shanghai.aliyuncs.com/output/**/" } }, "Outputs": [ { "OutputFile": "hd.mp4", "TemplateId": "S00000001-200030" }, { "OutputFile": "sd.mp4", "TemplateId": "S00000001-200020" } ] } ] }

UserData

string

No

Custom data to pass with the job.

{"videoId":"abcd"}

PipelineId

string

No

The ID of the pipeline for the transcoding job.

e197ecfb103e4849922b054d3032f954

Response elements

Element

Type

Description

Example

object

The result of submitting a media transcoding job.

RequestId

string

The request ID.

******11-DB8D-4A9A-875B-275798******

Job

object

The media transcoding job.

RequestId

string

The request ID.

A2129C9F-CE95-58B5-B8C1-07758FF6C86F

ClientToken

string

The idempotency token for the request.

FB7F25E9-AD9B-1603-8AF6-F1E42DF2E706

JobId

string

The job ID.

****20b48fb04483915d4f2cd8ac****

Config

object

The job configuration.

Inputs

array

The inputs for the media transcoding job.

MediaConvertInput

An input for the media transcoding job.

[{\"Src\":{\"Type\":\"MAP_SERVICE\",\"DataId\":\"479f6c63f66dcc1a9a09420fee32cbdf\",\"ZoomLevel\":18},\"Idx\":1}]

Outputs

array

The output configurations for the media transcoding job.

MediaConvertOutput

An output configuration for the media transcoding job.

[]

OutputGroups

array

The output group configurations for the media transcoding job.

MediaConvertOutputGroup

An output group configuration for the media transcoding job.

JobName

string

The job name.

Name

PipelineId

string

The pipeline ID.

***48a4edf410b908aecd91fc3b***

UserData

string

The user data.

{"videoId":"abcd"}

Code

string

The error code returned if the job fails.

InvalidParameter.ResourceContentBad

Message

string

The error message returned if the job fails.

The resource operated InputFile is bad

State

string

The job status. Valid values:

  • Inited: The job has been initialized.

  • Running: The job is running.

  • Success: The job has completed successfully.

  • Failed: The job has failed.

  • Canceled: The job has been canceled.

Success

OutputDetails

array

The output details.

MediaConvertOutputDetail

The details of a single output.

OutputGroupDetails

array

The output group details.

MediaConvertOutputGroupDetail

The details of a single output group.

Examples

Success response

JSON format

{
  "RequestId": "******11-DB8D-4A9A-875B-275798******",
  "Job": {
    "RequestId": "A2129C9F-CE95-58B5-B8C1-07758FF6C86F",
    "ClientToken": "FB7F25E9-AD9B-1603-8AF6-F1E42DF2E706",
    "JobId": "****20b48fb04483915d4f2cd8ac****",
    "Config": {
      "Inputs": [
        {
          "Name": "InputVideo",
          "InputFile": {
            "Type": "OSS",
            "Media": "http://bucket.loction.aliyuncs.com/path/to/video.mp4"
          }
        }
      ],
      "Outputs": [
        {
          "OutputFile": {
            "Type": "OSS",
            "Media": "http://bucket.loction.aliyuncs.com/path/to/video.mp4"
          },
          "Priority": 6,
          "OverrideParams": "{}",
          "Features": "{}",
          "TemplateId": "****96e8864746a0b6f3****",
          "Name": "output-video"
        }
      ],
      "OutputGroups": [
        {
          "GroupConfig": {
            "OutputFileBase": {
              "Type": "OSS",
              "Media": "http://bucket.loction.aliyuncs.com/path/to/video.mp4"
            },
            "ManifestName": "manifest",
            "Type": "Hls"
          },
          "Outputs": [
            {
              "Priority": 6,
              "OverrideParams": "{}",
              "Features": "{}",
              "OutputFileName": "720p.mp4",
              "TemplateId": "****96e8864746a0b6f3****\n",
              "Name": "group-output"
            }
          ],
          "Name": "hls-group"
        }
      ],
      "JobName": "Name"
    },
    "PipelineId": "***48a4edf410b908aecd91fc3b***",
    "UserData": "{\"videoId\":\"abcd\"}",
    "Code": "InvalidParameter.ResourceContentBad",
    "Message": "The resource operated InputFile is bad",
    "State": "Success",
    "OutputDetails": [
      {
        "Status": "Success",
        "TaskId": "******4215e042b3966ca5441e******",
        "Message": "The resource operated InputFile is bad\n",
        "FinishTime": "2024-12-07T13:01:07Z",
        "CreateTime": "2024-12-07T06:06:58Z",
        "Code": "InvalidParameter.ResourceContentBad\n",
        "Name": "720P-mp4",
        "Result": {
          "OutputFile": {
            "Type": "OSS",
            "Media": "oss://bucket/path/to/video.mp4\n",
            "Url": "oss://bucket/path/to/video.mp4"
          },
          "OutFileMeta": {
            "VideoStreamInfoList": [
              {
                "Rotate": "0",
                "Codec_tag": "0x001b",
                "Sar": "478:477",
                "Start_time": "1.473556",
                "Fps": "25.0",
                "Index": "0",
                "Duration": "403.039989",
                "Lang": "cn",
                "Codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                "PixFmt": "yuv420p",
                "Bit_rate": "888.563",
                "Profile": "High",
                "Has_b_frames": "2",
                "Codec_time_base": "1/50",
                "Dar": "16:9",
                "Avg_fps": "25.0",
                "Codec_tag_string": "[27][0][0][0]",
                "Codec_name": "h264",
                "Height": "478",
                "Level": "31",
                "Time_base": "1/90000",
                "Width": "848",
                "NumFrames": "10040"
              }
            ],
            "AudioStreamInfoList": [
              {
                "CodecTag": "0x000f",
                "CodecTimeBase": "1/44100",
                "ChannelLayout": "stereo",
                "StartTime": "1.473556",
                "Index": "1",
                "Duration": "403.039989",
                "Lang": "cn",
                "SampleFmt": "fltp",
                "CodecName": "aac",
                "Bitrate": "0.f",
                "Channels": "2",
                "Timebase": "1/90000",
                "CodecTagString": "[15][0][0][0]",
                "SampleRate": "44100",
                "CodecLongName": "AAC (Advanced Audio Coding)"
              }
            ],
            "FileBasicInfo": {
              "FileUrl": "http://bucket.oss-cn-shanghai.aliyuncs.com/path/to/file.m3u8",
              "FileStatus": "Normal",
              "MediaId": "9066406c306771f0bfa35107e0c90102",
              "FileType": "source_file",
              "FileName": "file.m3u8",
              "Region": "cn-shanghai",
              "FormatName": "hls,applehttp",
              "Duration": "403.039999",
              "Height": "478",
              "Bitrate": "888.563",
              "Width": "848",
              "FileSize": "31737"
            }
          }
        }
      }
    ],
    "OutputGroupDetails": [
      {
        "Status": "Success",
        "TaskId": "******22dad741d086a50325f9******",
        "Message": "The resource operated \"InputFile\" is bad",
        "FinishTime": "2025-03-21T01:48:41Z\n",
        "CreateTime": "2025-03-21T01:48:41Z",
        "Outputs": [
          {
            "Status": "Success",
            "TaskId": "******4215e042b3966ca5441e******",
            "Message": "The resource operated InputFile is bad\n",
            "FinishTime": "2024-12-07T13:01:07Z",
            "CreateTime": "2024-12-07T06:06:58Z",
            "Code": "InvalidParameter.ResourceContentBad\n",
            "Name": "720P-mp4",
            "Result": {
              "OutputFile": {
                "Type": "OSS",
                "Media": "oss://bucket/path/to/video.mp4\n",
                "Url": "oss://bucket/path/to/video.mp4"
              },
              "OutFileMeta": {
                "VideoStreamInfoList": [
                  {
                    "Rotate": "0",
                    "Codec_tag": "0x001b",
                    "Sar": "478:477",
                    "Start_time": "1.473556",
                    "Fps": "25.0",
                    "Index": "0",
                    "Duration": "403.039989",
                    "Lang": "cn",
                    "Codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                    "PixFmt": "yuv420p",
                    "Bit_rate": "888.563",
                    "Profile": "High",
                    "Has_b_frames": "2",
                    "Codec_time_base": "1/50",
                    "Dar": "16:9",
                    "Avg_fps": "25.0",
                    "Codec_tag_string": "[27][0][0][0]",
                    "Codec_name": "h264",
                    "Height": "478",
                    "Level": "31",
                    "Time_base": "1/90000",
                    "Width": "848",
                    "NumFrames": "10040"
                  }
                ],
                "AudioStreamInfoList": [
                  {
                    "CodecTag": "0x000f",
                    "CodecTimeBase": "1/44100",
                    "ChannelLayout": "stereo",
                    "StartTime": "1.473556",
                    "Index": "1",
                    "Duration": "403.039989",
                    "Lang": "cn",
                    "SampleFmt": "fltp",
                    "CodecName": "aac",
                    "Bitrate": "0.f",
                    "Channels": "2",
                    "Timebase": "1/90000",
                    "CodecTagString": "[15][0][0][0]",
                    "SampleRate": "44100",
                    "CodecLongName": "AAC (Advanced Audio Coding)"
                  }
                ],
                "FileBasicInfo": {
                  "FileUrl": "http://bucket.oss-cn-shanghai.aliyuncs.com/path/to/file.m3u8",
                  "FileStatus": "Normal",
                  "MediaId": "9066406c306771f0bfa35107e0c90102",
                  "FileType": "source_file",
                  "FileName": "file.m3u8",
                  "Region": "cn-shanghai",
                  "FormatName": "hls,applehttp",
                  "Duration": "403.039999",
                  "Height": "478",
                  "Bitrate": "888.563",
                  "Width": "848",
                  "FileSize": "31737"
                }
              }
            }
          }
        ],
        "Code": "InvalidParameter.ResourceContentBad",
        "Name": "hls-group"
      }
    ]
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.