Submits a transcoding job.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ice:SubmitTranscodeJob | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Name | string | No | The job name. | job-name |
InputGroup | array<object> | Yes | The input group of the job. An input of a single file indicates a transcoding job. An input of multiple files indicates an audio and video stream merge job. | job-name |
InputGroup | object | Yes | The input of the job. | |
Type | string | Yes | The type of the media object. Valid values:
| OSS |
Media | string | Yes | The media object.
Note
Before you use the OSS bucket in the URL, you must add the bucket on the Storage Management page of the Intelligent Media Services (IMS) console.
| oss://bucket/path/to/video.mp4 |
InputUrl | string | No | The URL of the input stream.
| oss://bucket/path/to/video.mp4 |
OutputGroup | array<object> | Yes | The output group of the job. | user-data |
OutputGroup | object | Yes | The output of the job. | |
Output | object | Yes | The output file configuration. | |
Type | string | Yes | The type of the media object. Valid values:
| OSS |
Media | string | Yes | The media object.
Note
Before you use the OSS bucket in the URL, you must add the bucket on the Storage Management page of the IMS console.
| oss://bucket/path/to/video.mp4 |
OutputUrl | string | No | The URL of the output stream.
| oss://bucket/path/to/{MediaId}/{JobId}.mp4 |
ProcessConfig | object | Yes | The job processing configuration. | |
Transcode | object | Yes | The transcoding configuration. | |
TemplateId | string | Yes | The template ID. | 9547c6ad97cb4f2aaa29683ebd18d410 |
OverwriteParams | object | No | The parameters that are used to overwrite the corresponding parameters of the template. | |
Video | object | No | The video settings. | |
Codec | string | No | The encoding format. | H.264 |
Profile | string | No | The encoding profile. Valid values: baseline, main, and high.
Default value: high. | Main |
Bitrate | string | No | The average video bitrate. Valid values: [10,50000]. Unit: Kbit/s. | 3000 |
Crf | string | No | The constant rate factor (CRF). Valid values: [0,51]. Default value: 23 if the encoding format is H.264, or 26 if the encoding format is H.265. Note
If this parameter is specified, the setting of the bitrate becomes invalid.
| 23 |
Width | string | No | The width of the video. Valid values: [128,4096]. Unit: pixels. Default value: the original width of the video. | 1920 |
Height | string | No | The height of the video. Valid values: [128,4096]. Unit: pixels. Default value: the original height of the video. | 1080 |
Fps | string | No | The frame rate. Valid values:(0,60]. Default value: the frame rate of the input file. Note
The value is 60 if the frame rate of the input file exceeds 60.
| 25 |
Gop | string | No | The maximum number of frames between keyframes. Valid values: [1,1080000]. Default value: 250. | 250 |
Preset | string | No | The preset video algorithm. This parameter takes effect only if the encoding format is H.264. Valid values: veryfast, fast, medium, slow, and slower. Default value: medium. | medium |
ScanMode | string | No | The scan mode. Valid values: interlaced and progressive. | progressive |
PixFmt | string | No | The pixel format of the video. Valid values: standard pixel formats such as yuv420p and yuvj420p. | yuv420p |
Remove | string | No | Specifies whether to remove the video. | false |
Crop | string | No | The method of video cropping. Valid values:
| 1280:800:0:140 |
Pad | string | No | The black bars added to the video. Format: width:height:left:top. Example: 1280:800:0:140. | 1280:800:0:140 |
LongShortMode | string | No | Specifies whether to enable the auto-rotate screen feature. | false |
Bufsize | string | No | The buffer size. Valid values: [1000,128000]. Default value: 6000. Unit: KB. | 6000 |
Maxrate | string | No | The maximum bitrate of the video. Valid values: [10,50000]. Unit: Kbit/s. | 9000 |
AbrMax | string | No | The maximum adaptive bitrate (ABR). This parameter takes effect only for Narrowband HD 1.0. Valid values: [10,50000]. Unit: Kbit/s. | 6000 |
Audio | object | No | The audio settings. | |
Codec | string | No | The audio codec. Valid values: AAC, MP3, VORBIS, and FLAC. Default value: AAC. | AAC |
Profile | string | No | The audio codec profile. If the Codec parameter is set to AAC, the valid values are aac_low, aac_he, aac_he_v2, aac_ld, and aac_eld. | aac_low |
Samplerate | string | No | The sampling rate. Valid values: 22050, 32000, 44100, 48000, and 96000. Default value: 44100. Unit: Hz. | 44100 |
Bitrate | string | No | The audio bitrate of the output file. Valid values: [8,1000]. Unit: Kbit/s. Default value: 128. | 128 |
Channels | string | No | The number of sound channels. Default value: 2. | 2 |
Remove | string | No | Specifies whether to delete the audio stream. | false |
Volume | object | No | The volume configurations. | |
Method | string | No | The volume adjustment method. Valid values: | auto |
IntegratedLoudnessTarget | string | No | The output volume. | -6 |
TruePeak | string | No | The peak volume. | -1 |
LoudnessRangeTarget | string | No | The volume range. | 8 |
Container | object | No | The encapsulation format settings. | |
Format | string | No | The container format. | mp4 |
MuxConfig | object | No | The encapsulation settings. | |
Segment | object | No | The segment settings. | |
Duration | string | No | The segment length. | 10 |
ForceSegTime | string | No | The forced segmentation point in time. | 2,3 |
TransConfig | object | No | The conditional transcoding configurations. | |
TransMode | string | No | The video transcoding mode. Valid values:
Default value: onepass. | onepass |
IsCheckReso | string | No | Specifies whether to check the video resolution. You can specify only one of the IsCheckReso and IsCheckResoFail parameters. The priority of the IsCheckResoFail parameter is higher. Valid values:
Default value: false. | true |
IsCheckResoFail | string | No | Specifies whether to check the video resolution. You can specify only one of the IsCheckReso and IsCheckResoFail parameters. The priority of the IsCheckResoFail parameter is higher. Valid values:
Default value: false. | true |
IsCheckVideoBitrate | string | No | Specifies whether to check the video bitrate. You can specify only one of the IsCheckVideoBitrate and IsCheckVideoBitrateFail parameters. The priority of the IsCheckVideoBitrateFail parameter is higher. Valid values:
Default value: false. | true |
IsCheckVideoBitrateFail | string | No | Specifies whether to check the video bitrate. You can specify only one of the IsCheckVideoBitrate and IsCheckVideoBitrateFail parameters. The priority of the IsCheckVideoBitrateFail parameter is higher. Valid values:
Default value: false. | true |
IsCheckAudioBitrate | string | No | Specifies whether to check the audio bitrate. You can specify only one of the IsCheckAudioBitrate and IsCheckAudioBitrateFail parameters. The priority of the IsCheckAudioBitrateFail parameter is higher. Valid values:
Default value:
| true |
IsCheckAudioBitrateFail | string | No | Specifies whether to check the audio bitrate. You can specify only one of the IsCheckAudioBitrate and IsCheckAudioBitrateFail parameters. The priority of the IsCheckAudioBitrateFail parameter is higher. Valid values:
Default value: false. | true |
AdjDarMethod | string | No | The method that is used to adjust the resolution. This parameter takes effect only if both the Width and Height parameters are specified. You can use this parameter together with the LongShortMode parameter. Valid values: rescale, crop, pad, and none. Default value: none. | none |
ImageWatermarks | array<object> | No | The watermark configuration of an image. | |
ImageWatermark | object | No | The watermark configuration of an image. | |
TemplateId | string | Yes | The template ID. | 9547c6ad97cb4f2aaa29683ebd18d410 |
OverwriteParams | object | No | The parameters that are used to overwrite the corresponding parameters of the template. | |
Width | string | No | The width of the watermark in the output video. The following value types are supported:
| 32 |
Height | string | No | The height of the watermark image in the output video. The following value types are supported:
| 32 |
Dx | string | No | The horizontal offset of the watermark relative to the output video. Default value: 0. The following value types are supported:
| 10 |
Dy | string | No | The vertical offset of the watermark relative to the output video. Default value: 0. The following value types are supported:
| 10 |
ReferPos | string | No | The position of the watermark.
| TopLeft |
Timeline | object | No | The time settings of the dynamic watermark. | |
Start | string | No | The beginning of the time range in which the watermark is displayed.
| 00:00:05 |
Duration | string | No | The time range in which the watermark is displayed.
| ToEND |
File | object | No | The watermark image file. | |
Type | string | No | The type of the media object. Valid values:
| OSS |
Media | string | No | The media object.
| oss://bucket/path/to/video.mp4 |
TextWatermarks | array<object> | No | The configurations of the text watermark. | |
TextWatermark | object | No | The configurations of the text watermark. | |
TemplateId | string | Yes | The template ID. | 9547c6ad97cb4f2aaa29683ebd18d410 |
OverwriteParams | object | No | The parameters that are used to overwrite the corresponding parameters of the template. | |
Content | string | No | The watermark text. Base64 encoding is not required. The string must be encoded in UTF-8. | |
FontName | string | No | The font of the text. Default value: SimSun. | SimSun |
FontColor | string | No | The color of the text. | #006400 |
FontAlpha | string | No | The transparency of the text.
| 1.0 |
Top | string | No | The top margin of the text.
| 10 |
Left | string | No | The left margin of the text watermark.
| 10 |
FontSize | integer | No | The size of the text.
| 16 |
BorderWidth | integer | No | The outline width of the text watermark.
| 0 |
BorderColor | string | No | The outline color of the text watermark. Default value: black. For more information, see BorderColor. | #006400 |
Adaptive | string | No | Specifies whether to the font size based on the output video dimensions. true / false, default: false | false |
Subtitles | array<object> | No | The subtitle configuration. | |
Subtitle | object | No | The subtitle configuration. | |
TemplateId | string | Yes | The template ID. | 9547c6ad97cb4f2aaa29683ebd18d410 |
OverwriteParams | object | No | The parameters that are used to overwrite the corresponding parameters of the template. | |
Format | string | No | The format of the subtitle file. | vtt |
CharEnc | string | No | The file encoding format. | UTF-8 |
File | object | No | The subtitle file. | |
Type | string | No | The type of the media object. Valid values:
| OSS |
Media | string | No | The media object.
| oss://bucket/path/to/video.mp4 |
Encryption | object | No | The encryption settings. | |
EncryptType | string | No | Specifies the encryption type. Valid values:
| PrivateEncryption |
CipherText | string | No | The ciphertext of HTTP Live Streaming (HLS) encryption. | MTYi00NDU0LTg5O**** |
DecryptKeyUri | string | No | The address of the decryption service for HLS encryption. | https://sample.com/path?CipherText=MTYi00NDU0LTg5O**** |
KeyServiceType | string | No | The key service type for HLS encryption. Valid values:
| KMS |
CombineConfigs | array<object> | No | The multi-input stream merge configuration. | |
object | No | The stream merge configuration. | ||
AudioIndex | string | Yes | The audio stream index. | |
VideoIndex | string | Yes | The video stream index. | |
Start | double | No | The start time of the input stream. Default value: 0. | 0.0 |
Duration | double | No | The duration of the input stream. The default value is the duration of the video. | 20.0 |
UserData | string | No | The custom settings. The value must be in the JSON format and can be up to 512 bytes in length. You can specify a custom callback URL. | user-data |
ScheduleConfig | object | No | The scheduling information about the job. | |
PipelineId | string | No | The ID of the MPS queue to which the job was submitted. | e37ebee5d98b4781897f6086e89f9c56 |
Priority | integer | No | The priority of the job. Valid values: 1 to 10. The greater the value, the higher the priority. | 5 |
ClientToken | string | No | The client token that is used to ensure the idempotence of the request. | ****12e8864746a0a398**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "31E30781-9495-5E2D-A84D-759B0A01E262",
"TranscodeParentJob": {
"TranscodeJobList": [
{
"CreateTime": "2022-01-12T08:49:41Z",
"Name": "transcode-job",
"ParentJobId": "8b2198504dd340b7b3c9842a74fc9baa",
"JobId": "7d6a7e0d4db2457a8d45ff5d43e1bf0a",
"JobIndex": 0,
"InputGroup": [
{
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4",
"InputUrl": "oss://bucket/path/to/video.mp4\n"
}
],
"ProcessConfig": {
"Transcode": {
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Video": {
"Codec": "H.264",
"Profile": "Main",
"Bitrate": "3000",
"Crf": "23",
"Width": "1920",
"Height": "1080",
"Fps": "25",
"Gop": "250",
"Preset": "medium",
"ScanMode": "progressive",
"PixFmt": "yuv420p",
"Remove": "false",
"Crop": "1280:800:0:140",
"Pad": "1280:800:0:140",
"LongShortMode": "false",
"Bufsize": "6000",
"Maxrate": "9000",
"AbrMax": "6000"
},
"Audio": {
"Codec": "AAC",
"Profile": "aac_low",
"Samplerate": "44100",
"Bitrate": "128",
"Channels": "2",
"Remove": "false",
"Volume": {
"Method": "auto",
"IntegratedLoudnessTarget": "-6",
"TruePeak": "-1",
"LoudnessRangeTarget": "8"
}
},
"Container": {
"Format": "mp4"
},
"MuxConfig": {
"Segment": {
"Duration": "10",
"ForceSegTime": "2,3"
}
},
"TransConfig": {
"TransMode": "onepass",
"IsCheckReso": "true",
"IsCheckResoFail": "true",
"IsCheckVideoBitrate": "true",
"IsCheckVideoBitrateFail": "true",
"IsCheckAudioBitrate": "true",
"IsCheckAudioBitrateFail": "true",
"AdjDarMethod": "none"
}
}
},
"ImageWatermarks": [
{
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Width": "32",
"Height": "32",
"Dx": "10",
"Dy": "10",
"ReferPos": "TopLeft",
"Timeline": {
"Start": "00:00:05",
"Duration": "ToEND"
},
"File": {
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4"
}
}
}
],
"TextWatermarks": [
{
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Content": "",
"FontName": "SimSun",
"FontColor": "#006400",
"FontAlpha": "1.0",
"Top": "10",
"Left": "10",
"FontSize": 16,
"BorderWidth": 0,
"BorderColor": "#006400",
"Adaptive": "false"
}
}
],
"Subtitles": [
{
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Format": "vtt",
"CharEnc": "UTF-8",
"File": {
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4"
}
}
}
],
"Encryption": {
"EncryptType": "PrivateEncryption",
"CipherText": "MTYi00NDU0LTg5O****",
"DecryptKeyUri": "https://sample.com/path?CipherText=MTYi00NDU0LTg5O****",
"KeyServiceType": "KMS"
},
"CombineConfigs": [
{
"AudioIndex": "",
"VideoIndex": "",
"Start": 0,
"Duration": 20
}
]
},
"Output": {
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4",
"OutputUrl": "oss://bucket/path/to/{MediaId}/{JobId}.mp4\n"
},
"UserData": "user-data",
"ScheduleConfig": {
"PipelineId": "e37ebee5d98b4781897f6086e89f9c56",
"Priority": 5
},
"Status": "Init",
"OutFileMeta": {
"FileBasicInfo": {
"MediaId": "73e07de0f77171eca3fc7035d0b26402",
"FileName": "file.m3u8",
"FileStatus": "Normal",
"FileType": "source_file",
"FileSize": "31737",
"FileUrl": "http://bucket.oss-cn-shanghai.aliyuncs.com/path/to/file.m3u8",
"Region": "cn-shanghai",
"FormatName": "hls,applehttp",
"Duration": "403.039999",
"Bitrate": "888.563",
"Width": "848",
"Height": "478"
},
"AudioStreamInfoList": [
{
"Index": "1",
"CodecName": "aac",
"CodecLongName": "AAC (Advanced Audio Coding)",
"CodecTimeBase": "1/44100",
"CodecTagString": "[15][0][0][0]",
"CodecTag": "0x000f",
"SampleFmt": "fltp",
"SampleRate": "44100",
"Channels": "2",
"ChannelLayout": "stereo",
"Timebase": "1/90000",
"StartTime": "1.473556",
"Duration": "403.039989",
"Bitrate": "0.f",
"Lang": "cn"
}
],
"VideoStreamInfoList": [
{
"Index": "0",
"Codec_name": "h264",
"Codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"Profile": "High",
"Codec_time_base": "1/50",
"Codec_tag_string": "[27][0][0][0]",
"Codec_tag": "0x001b",
"Width": "848",
"Height": "478",
"Has_b_frames": "2",
"Sar": "478:477",
"Dar": "16:9",
"PixFmt": "yuv420p",
"Level": "31",
"Fps": "25.0",
"Avg_fps": "25.0",
"Time_base": "1/90000",
"Start_time": "1.473556",
"Duration": "403.039989",
"Bit_rate": "888.563",
"NumFrames": "10040",
"Lang": "cn",
"Rotate": "0"
}
]
},
"SubmitResultJson": {},
"SubmitTime": "2022-01-12T08:49:41Z",
"FinishTime": "2022-01-12T08:49:41Z",
"RequestId": "31E30781-9495-5E2D-A84D-759B0A01E262"
}
],
"CreateTime": "2022-01-12T08:49:41Z",
"Name": "transcode-job",
"RequestId": "31E30781-9495-5E2D-A84D-759B0A01E262",
"ParentJobId": "8b2198504dd340b7b3c9842a74fc9baa",
"JobCount": 1,
"Status": "Success",
"TriggerSource": "API",
"Percent": 0,
"SubmitTime": "2022-01-12T08:49:41Z",
"FinishTime": "2022-01-12T08:49:41Z",
"InputGroup": [
{
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4"
}
],
"OutputGroup": [
{
"Output": {
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4"
},
"ProcessConfig": {
"Transcode": {
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Video": {
"Codec": "H.264",
"Profile": "Main",
"Bitrate": "3000",
"Crf": "23",
"Width": "1920",
"Height": "1080",
"Fps": "25",
"Gop": "250",
"Preset": "medium",
"ScanMode": "progressive",
"PixFmt": "yuv420p",
"Remove": "false",
"Crop": "1280:800:0:140",
"Pad": "1280:800:0:140",
"LongShortMode": "false",
"Bufsize": "6000",
"Maxrate": "9000",
"AbrMax": "6000"
},
"Audio": {
"Codec": "AAC",
"Profile": "aac_low",
"Samplerate": "44100",
"Bitrate": "128",
"Channels": "2",
"Remove": "false",
"Volume": {
"Method": "auto",
"IntegratedLoudnessTarget": "-6",
"TruePeak": "-1",
"LoudnessRangeTarget": "8"
}
},
"Container": {
"Format": "mp4"
},
"MuxConfig": {
"Segment": {
"Duration": "10",
"ForceSegTime": "2,3"
}
},
"TransConfig": {
"TransMode": "onepass",
"IsCheckReso": "true",
"IsCheckResoFail": "true",
"IsCheckVideoBitrate": "true",
"IsCheckVideoBitrateFail": "true",
"IsCheckAudioBitrate": "true",
"IsCheckAudioBitrateFail": "true",
"AdjDarMethod": "none"
}
}
},
"ImageWatermarks": [
{
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Width": "32",
"Height": "32",
"Dx": "10",
"Dy": "10",
"ReferPos": "TopLeft",
"Timeline": {
"Start": "00:00:05",
"Duration": "ToEND"
},
"File": {
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4"
}
}
}
],
"TextWatermarks": [
{
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Content": "",
"FontName": "SimSun",
"FontColor": "#006400",
"FontAlpha": "1.0",
"Top": "10",
"Left": "10",
"FontSize": 16,
"BorderWidth": 0,
"BorderColor": "#006400",
"Adaptive": "false"
}
}
],
"Subtitles": [
{
"TemplateId": "9547c6ad97cb4f2aaa29683ebd18d410",
"OverwriteParams": {
"Format": "vtt",
"CharEnc": "UTF-8",
"File": {
"Type": "OSS",
"Media": "oss://bucket/path/to/video.mp4"
}
}
}
],
"Encryption": {
"EncryptType": "PrivateEncryption",
"CipherText": "MTYi00NDU0LTg5O****",
"DecryptKeyUri": "https://sample.com/path?CipherText=MTYi00NDU0LTg5O****",
"KeyServiceType": "KMS"
},
"CombineConfigs": [
{
"AudioIndex": "",
"VideoIndex": "",
"Start": 0,
"Duration": 20
}
]
}
}
],
"UserData": "user-data",
"ScheduleConfig": {
"PipelineId": "e37ebee5d98b4781897f6086e89f9c56",
"Priority": 5
}
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-11-07 | The response structure of the API has changed | View Change Details |
2023-10-18 | The response structure of the API has changed | View Change Details |
2023-10-10 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-06-06 | The response structure of the API has changed | View Change Details |
2023-05-18 | The response structure of the API has changed | View Change Details |
2022-09-20 | The response structure of the API has changed | View Change Details |
2022-08-10 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2022-07-11 | Add Operation | View Change Details |