All Products
Search
Document Center

Intelligent Media Services:SubmitTranscodeJob

Last Updated:Dec 16, 2024

Submits a transcoding job.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ice:SubmitTranscodeJob
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringNo

The job name.

job-name
InputGrouparray<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
InputGroupobjectYes

The input of the job.

TypestringYes

The type of the media object. Valid values:

  • OSS: an Object Storage Service (OSS) object.
  • Media: a media asset.
OSS
MediastringYes

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
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.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
InputUrlstringNo

The URL of the input stream.

  • This parameter takes effect only when Type is set to Media. You can select a specific file within the media asset as an input.
  • The system checks whether the input URL exists within the media asset.
oss://bucket/path/to/video.mp4
OutputGrouparray<object>Yes

The output group of the job.

user-data
OutputGroupobjectYes

The output of the job.

OutputobjectYes

The output file configuration.

TypestringYes

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
MediastringYes

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
Note Before you use the OSS bucket in the URL, you must add the bucket on the Storage Management page of the IMS console.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
OutputUrlstringNo

The URL of the output stream.
This parameter takes effect only when Type is set to Media. You can select a specific file within the media asset as an output.
Supported placeholders:

  • {MediaId}: the ID of the media asset.
  • {JobId}: the ID of the transcoding subjob.
  • {MediaBucket}: the bucket to which the media asset belongs.
  • {ExtName}: the file suffix, which uses the output format of the transcoding template.
  • {DestMd5}: the MD5 value of the transcoded output file.
    Notes:
  1. This parameter must contain the {MediaId} and {JobId} placeholders.
  2. The output bucket is the same as the bucket to which the media asset belongs.
oss://bucket/path/to/{MediaId}/{JobId}.mp4
ProcessConfigobjectYes

The job processing configuration.

TranscodeobjectYes

The transcoding configuration.

TemplateIdstringYes

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobjectNo

The parameters that are used to overwrite the corresponding parameters of the template.

VideoobjectNo

The video settings.

CodecstringNo

The encoding format.

H.264
ProfilestringNo

The encoding profile. Valid values: baseline, main, and high.

  • baseline: applicable to mobile devices.
  • main: applicable to standard-definition devices.
  • high: applicable to high-definition devices.

Default value: high.

Main
BitratestringNo

The average video bitrate. Valid values: [10,50000]. Unit: Kbit/s.

3000
CrfstringNo

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
WidthstringNo

The width of the video. Valid values: [128,4096]. Unit: pixels. Default value: the original width of the video.

1920
HeightstringNo

The height of the video. Valid values: [128,4096]. Unit: pixels. Default value: the original height of the video.

1080
FpsstringNo

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
GopstringNo

The maximum number of frames between keyframes. Valid values: [1,1080000]. Default value: 250.

250
PresetstringNo

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
ScanModestringNo

The scan mode. Valid values: interlaced and progressive.

progressive
PixFmtstringNo

The pixel format of the video. Valid values: standard pixel formats such as yuv420p and yuvj420p.

yuv420p
RemovestringNo

Specifies whether to remove the video.

false
CropstringNo

The method of video cropping. Valid values:

  • border: automatically detects and removes black bars.
  • A value in the width:height:left:top format: crops the videos based on the custom settings. Example: 1280:800:0:140.
1280:800:0:140
PadstringNo

The black bars added to the video. Format: width:height:left:top. Example: 1280:800:0:140.

1280:800:0:140
LongShortModestringNo

Specifies whether to enable the auto-rotate screen feature.

false
BufsizestringNo

The buffer size. Valid values: [1000,128000]. Default value: 6000. Unit: KB.

6000
MaxratestringNo

The maximum bitrate of the video. Valid values: [10,50000]. Unit: Kbit/s.

9000
AbrMaxstringNo

The maximum adaptive bitrate (ABR). This parameter takes effect only for Narrowband HD 1.0. Valid values: [10,50000]. Unit: Kbit/s.

6000
AudioobjectNo

The audio settings.

CodecstringNo

The audio codec. Valid values: AAC, MP3, VORBIS, and FLAC. Default value: AAC.

AAC
ProfilestringNo

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
SampleratestringNo

The sampling rate. Valid values: 22050, 32000, 44100, 48000, and 96000. Default value: 44100. Unit: Hz.

44100
BitratestringNo

The audio bitrate of the output file. Valid values: [8,1000]. Unit: Kbit/s. Default value: 128.

128
ChannelsstringNo

The number of sound channels. Default value: 2.

2
RemovestringNo

Specifies whether to delete the audio stream.

false
VolumeobjectNo

The volume configurations.

MethodstringNo

The volume adjustment method. Valid values:

auto
IntegratedLoudnessTargetstringNo

The output volume.

-6
TruePeakstringNo

The peak volume.

-1
LoudnessRangeTargetstringNo

The volume range.

8
ContainerobjectNo

The encapsulation format settings.

FormatstringNo

The container format.

mp4
MuxConfigobjectNo

The encapsulation settings.

SegmentobjectNo

The segment settings.

DurationstringNo

The segment length.

10
ForceSegTimestringNo

The forced segmentation point in time.

2,3
TransConfigobjectNo

The conditional transcoding configurations.

TransModestringNo

The video transcoding mode. Valid values:

  • onepass: You can set this parameter to onepass if the Bitrate parameter is set to ABR. The encoding speed of this mode is faster than that of the twopass mode.
  • twopass: You can set this parameter to twopass if the Bitrate parameter is set to VBR. The encoding speed of this mode is slower than that of the onepass mode.
  • CBR: the constant bitrate mode.

Default value: onepass.

onepass
IsCheckResostringNo

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:

  • true: checks the video resolution. If the width or height of the input video is less than that of the output video, the resolution of the input video is used for transcoding.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckResoFailstringNo

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:

  • true: checks the video resolution. If the width or height of the input video is less than that of the output video, the transcoding job fails.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckVideoBitratestringNo

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:

  • true: checks the video resolution. If the bitrate of the input video is less than that of the output video, the bitrate of the input video is used for transcoding.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckVideoBitrateFailstringNo

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:

  • true: checks the video resolution. If the bitrate of the input video is less than that of the output video, the transcoding job fails.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckAudioBitratestringNo

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:

  • true: checks the video resolution. If the bitrate of the input audio is less than that of the output audio, the bitrate of the input audio is used for transcoding.
  • false: does not check the video resolution.

Default value:

  • If this parameter is not specified and the codec of the output audio is different from that of the input audio, the default value is false.
  • If this parameter is not specified and the codec of the output audio is the same as that of the input audio, the default value is true.
true
IsCheckAudioBitrateFailstringNo

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:

  • true: checks the video resolution. If the bitrate of the input audio is less than that of the output audio, the transcoding job fails.
  • false: does not check the video resolution.

Default value: false.

true
AdjDarMethodstringNo

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
ImageWatermarksarray<object>No

The watermark configuration of an image.

ImageWatermarkobjectNo

The watermark configuration of an image.

TemplateIdstringYes

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobjectNo

The parameters that are used to overwrite the corresponding parameters of the template.

WidthstringNo

The width of the watermark in the output video. The following value types are supported:

  • Integer: the pixel value of the watermark width.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the watermark width to the width of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
32
HeightstringNo

The height of the watermark image in the output video. The following value types are supported:

  • Integer: the pixel value of the watermark height.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the watermark height to the height of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
32
DxstringNo

The horizontal offset of the watermark relative to the output video. Default value: 0.

The following value types are supported:

  • Integer: the pixel value of the horizontal offset.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the horizontal offset to the width of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
10
DystringNo

The vertical offset of the watermark relative to the output video. Default value: 0.

The following value types are supported:

  • Integer: the pixel value of the horizontal offset.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the vertical offset to the height of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
10
ReferPosstringNo

The position of the watermark.

  • Valid values: TopRight, TopLeft, BottomRight, and BottomLeft.
  • Default value: TopRight.
TopLeft
TimelineobjectNo

The time settings of the dynamic watermark.

StartstringNo

The beginning of the time range in which the watermark is displayed.

  • Unit: seconds.
  • Value values: integers.
  • Default value: 0.
00:00:05
DurationstringNo

The time range in which the watermark is displayed.

  • Valid values: integers and ToEND.
  • Default value: ToEND.
ToEND
FileobjectNo

The watermark image file.

TypestringNo

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
MediastringNo

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
TextWatermarksarray<object>No

The configurations of the text watermark.

TextWatermarkobjectNo

The configurations of the text watermark.

TemplateIdstringYes

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobjectNo

The parameters that are used to overwrite the corresponding parameters of the template.

ContentstringNo

The watermark text. Base64 encoding is not required. The string must be encoded in UTF-8.

FontNamestringNo

The font of the text. Default value: SimSun.

SimSun
FontColorstringNo

The color of the text.

#006400
FontAlphastringNo

The transparency of the text.

  • Valid values: (0,1].
  • Default value: 1.
1.0
TopstringNo

The top margin of the text.

  • Default value: 0.
  • Valid values: [0,4096].
10
LeftstringNo

The left margin of the text watermark.

  • Default value: 0.
  • Valid values: [0,4096].
10
FontSizeintegerNo

The size of the text.

  • Default value: 16.
  • Valid values: (4,120).
16
BorderWidthintegerNo

The outline width of the text watermark.

  • Default value: 0.
  • Valid values: (0,4096].
0
BorderColorstringNo

The outline color of the text watermark. Default value: black. For more information, see BorderColor.

#006400
AdaptivestringNo

Specifies whether to the font size based on the output video dimensions. true / false, default: false

false
Subtitlesarray<object>No

The subtitle configuration.

SubtitleobjectNo

The subtitle configuration.

TemplateIdstringYes

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobjectNo

The parameters that are used to overwrite the corresponding parameters of the template.

FormatstringNo

The format of the subtitle file.

vtt
CharEncstringNo

The file encoding format.

UTF-8
FileobjectNo

The subtitle file.

TypestringNo

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
MediastringNo

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
EncryptionobjectNo

The encryption settings.

EncryptTypestringNo

Specifies the encryption type. Valid values:

  • PrivateEncryption: Alibaba Cloud proprietary cryptography
  • HLSEncryption: HTTP Live Streaming (HLS) encryption
PrivateEncryption
CipherTextstringNo

The ciphertext of HTTP Live Streaming (HLS) encryption.

MTYi00NDU0LTg5O****
DecryptKeyUristringNo

The address of the decryption service for HLS encryption.

https://sample.com/path?CipherText=MTYi00NDU0LTg5O****
KeyServiceTypestringNo

The key service type for HLS encryption. Valid values:

  • KMS
  • Base64
KMS
CombineConfigsarray<object>No

The multi-input stream merge configuration.

objectNo

The stream merge configuration.

AudioIndexstringYes

The audio stream index.

VideoIndexstringYes

The video stream index.

StartdoubleNo

The start time of the input stream. Default value: 0.

0.0
DurationdoubleNo

The duration of the input stream. The default value is the duration of the video.

20.0
UserDatastringNo

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
ScheduleConfigobjectNo

The scheduling information about the job.

PipelineIdstringNo

The ID of the MPS queue to which the job was submitted.

e37ebee5d98b4781897f6086e89f9c56
PriorityintegerNo

The priority of the job. Valid values: 1 to 10. The greater the value, the higher the priority.

5
ClientTokenstringNo

The client token that is used to ensure the idempotence of the request.

****12e8864746a0a398****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

31E30781-9495-5E2D-A84D-759B0A01E262
TranscodeParentJobobject

TranscodeParentJobWithSubJobDTO

TranscodeJobListarray<object>

The list of subjobs.

TranscodeJobListobject

The details of the subjobs.

CreateTimestring

The time when the job was created.

2022-01-12T08:49:41Z
Namestring

The job name.

transcode-job
ParentJobIdstring

The main job ID.

8b2198504dd340b7b3c9842a74fc9baa
JobIdstring

The subjob ID.

7d6a7e0d4db2457a8d45ff5d43e1bf0a
JobIndexinteger

The index number of the subjob in the entire job.

0
InputGrouparray<object>

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.

InputGroupobject

The information about the job input.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
InputUrlstring

The URL of the input stream:

  • This parameter takes effect only when Type is set to Media. You can select a specific file within the media asset as an input.
  • The system checks whether the input URL exists within the media asset.
oss://bucket/path/to/video.mp4
ProcessConfigobject

The transcoding configuration.

Transcodeobject

The transcoding configuration.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Videoobject

The video settings.

Codecstring

The encoding format.

H.264
Profilestring

The encoding profile. Valid values: baseline, main, and high.

  • baseline: applicable to mobile devices.
  • main: applicable to standard-definition devices.
  • high: applicable to high-definition devices.

Default value: high.

Main
Bitratestring

The average bitrate of the video.

  • Valid values: [10,50000].
  • Unit: Kbit/s.
3000
Crfstring

The constant rate factor.

  • Valid values: [0,51].
  • Default value: 23 if the encoding format is H.264, or Default value when the Codec parameter is set to H.265: 26.

If this parameter is specified, the value of Bitrate becomes invalid.

23
Widthstring

The width of the output video.

  • Valid values: [128,4096].
  • Unit: pixels.
  • Default value: the width of the input video.
1920
Heightstring

The height of the output video.

  • Valid values: [128,4096].
  • Unit: pixels.
  • Default value: the height of the input video.
1080
Fpsstring

The frame rate.

  • Valid values: (0,60].
  • The value is 60 if the frame rate of the input video exceeds 60.
  • Default value: the frame rate of the input video.
25
Gopstring

The maximum number of frames between two keyframes.

  • Valid values: [1,1080000].
  • Default value: 250.
250
Presetstring

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
ScanModestring

The scan mode. Valid values: interlaced and progressive.

progressive
PixFmtstring

The pixel format of the video. Valid values: standard pixel formats such as yuv420p and yuvj420p.

yuv420p
Removestring

Specifies whether to remove the video.

false
Cropstring

The method of video cropping. Valid values:

  • border: automatically detects and removes black bars.
  • A value in the width:height:left:top format: crops the videos based on the custom settings. Example: 1280:800:0:140.
1280:800:0:140
Padstring

The black bars added to the video.

  • Format: width:height:left:top.
  • Example: 1280:800:0:140.
1280:800:0:140
LongShortModestring

Specifies whether to enable the auto-rotate screen feature.

false
Bufsizestring

The buffer size.

  • Valid values: [1000,128000].
  • Default value: 6000.
  • Unit: KB.
6000
Maxratestring

The maximum bitrate of the output video. Valid values: [10,50000]. Unit: Kbit/s.

9000
AbrMaxstring

The maximum ABR. This parameter takes effect only for Narrowband HD 1.0. Valid values: [10,50000]. Unit: Kbit/s.

6000
Audioobject

The audio settings.

Codecstring

The audio codec. Valid values: AAC, MP3, VORBIS, and FLAC. Default value: AAC.

AAC
Profilestring

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
Sampleratestring

The sampling rate.

  • Default value: 44100.
  • Valid values: 22050, 32000, 44100, 48000, and 96000.
  • Unit: Hz.
44100
Bitratestring

The audio bitrate of the output file.

  • Valid values: [8,1000].
  • Unit: Kbit/s.
  • Default value: 128.
128
Channelsstring

The number of sound channels. Default value: 2.

2
Removestring

Specifies whether to delete the audio stream.

false
Volumeobject

The volume configurations.

Methodstring

The volume adjustment method. Valid values:

auto
IntegratedLoudnessTargetstring

The output volume.

-6
TruePeakstring

The peak volume.

-1
LoudnessRangeTargetstring

The volume range.

8
Containerobject

The encapsulation format settings.

Formatstring

The container format.

mp4
MuxConfigobject

The encapsulation settings.

Segmentobject

The segment settings.

Durationstring

The segment length.

10
ForceSegTimestring

The forced segmentation point in time.

2,3
TransConfigobject

The conditional transcoding configurations.

TransModestring

The video transcoding mode. Valid values:

  • onepass: You can set this parameter to onepass if the Bitrate parameter is set to ABR. This is the default value. The encoding speed of this mode is faster than that of the twopass mode.
  • twopass: You can set this parameter to twopass if the Bitrate parameter is set to VBR. The encoding speed of this mode is slower than that of the onepass mode.
  • CBR: the constant bitrate mode.
onepass
IsCheckResostring

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:

  • true: checks the video resolution. If the width or height of the input video is less than that of the output video, the resolution of the input video is used for transcoding.
  • false: does not check the video resolution. This is the default value.
true
IsCheckResoFailstring

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:

  • true: checks the video resolution. If the width or height of the input video is less than that of the output video, the transcoding job fails.
  • false: does not check the video resolution. This is the default value.
true
IsCheckVideoBitratestring

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:

  • true: checks the video resolution. If the bitrate of the input video is less than that of the output video, the bitrate of the input video is used for transcoding.
  • false: does not check the video resolution. This is the default value.
true
IsCheckVideoBitrateFailstring

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:

  • true: checks the video resolution. If the bitrate of the input video is less than that of the output video, the transcoding job fails.
  • false: does not check the video resolution. This is the default value.
true
IsCheckAudioBitratestring

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:

  • true: checks the video resolution. If the bitrate of the input audio is less than that of the output audio, the bitrate of the input audio is used for transcoding.
  • false: does not check the video resolution.

Default values:

  • If this parameter is not specified and the codec of the output audio is different from that of the input audio, the default value is false.
  • If this parameter is not specified and the codec of the output audio is the same as that of the input audio, the default value is true.
true
IsCheckAudioBitrateFailstring

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:

  • true: checks the video resolution. If the bitrate of the input audio is less than that of the output audio, the transcoding job fails.
  • false: does not check the video resolution. This is the default value.
true
AdjDarMethodstring

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
ImageWatermarksarray<object>

The watermark configuration of an image.

ImageWatermarkobject

The watermark configuration of an image.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Widthstring

The width of the watermark in the output video. The following value types are supported:

  • Integer: the pixel value of the watermark width.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the watermark width to the width of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
32
Heightstring

The height of the watermark image in the output video. The following value types are supported:

  • Integer: the pixel value of the watermark height.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the watermark height to the height of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
32
Dxstring

The horizontal offset of the watermark relative to the output video. Default value: 0.

The following value types are supported:

  • Integer: the pixel value of the horizontal offset.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the horizontal offset to the width of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
10
Dystring

The vertical offset of the watermark relative to the output video. Default value: 0.

The following value types are supported:

  • Integer: the pixel value of the horizontal offset.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the vertical offset to the height of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
10
ReferPosstring

The position of the watermark.

  • Valid values: TopRight, TopLeft, BottomRight, and BottomLeft.
  • Default value: TopRight.
TopLeft
Timelineobject

The time settings of the dynamic watermark.

Startstring

The beginning of the time range in which the watermark is displayed.

  • Unit: seconds.
  • Value values: integers.
  • Default value: 0.
00:00:05
Durationstring

The time range in which the watermark is displayed.

  • Valid values: integers and ToEND.
  • Default value: ToEND.
ToEND
Fileobject

The watermark image file.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
TextWatermarksarray<object>

The configurations of the text watermark.

TextWatermarkobject

The configurations of the text watermark.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Contentstring

The watermark text. Base64 encoding is not required. The string must be encoded in UTF-8.

FontNamestring

The font of the text. Default value: SimSun.

SimSun
FontColorstring

The color of the text.

#006400
FontAlphastring

The transparency of the text.

  • Valid values: (0,1].
  • Default value: 1.
1.0
Topstring

The top margin of the text.

  • Default value: 0.
  • Valid values: [0,4096].
10
Leftstring

The left margin of the text watermark.

  • Default value: 0.
  • Valid values: [0,4096].
10
FontSizeinteger

The size of the text.

  • Default value: 16.
  • Valid values: (4,120).
16
BorderWidthinteger

The outline width of the text watermark.

  • Default value: 0.
  • Valid values: (0,4096].
0
BorderColorstring

The outline color of the text watermark. Default value: black. For more information, see BorderColor.

#006400
Adaptivestring

Specifies whether to the font size based on the output video dimensions. true / false, default: false

false
Subtitlesarray<object>

The subtitle configuration.

Subtitleobject

The subtitle configuration.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Formatstring

The format of the subtitle file.

vtt
CharEncstring

The file encoding format.

UTF-8
Fileobject

The subtitle file.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
Encryptionobject

The encryption settings.

EncryptTypestring

Specifies the encryption type.

PrivateEncryption
CipherTextstring

The ciphertext of HLS encryption.

MTYi00NDU0LTg5O****
DecryptKeyUristring

The address of the decryption service for HLS encryption.

https://sample.com/path?CipherText=MTYi00NDU0LTg5O****
KeyServiceTypestring

The type of the key service. Valid values: KMS and Base64.

KMS
CombineConfigsarray<object>

The multi-input stream merge configuration.

CombineConfigobject

The stream merge configuration.

AudioIndexstring

The audio stream index.

VideoIndexstring

The video stream index.

Startdouble

The start time of the input stream. Default value: 0.

0.0
Durationdouble

The duration of the input stream. The default value is the duration of the video.

20.0
Outputobject

The output file configuration.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
OutputUrlstring

The URL of the output stream.
This parameter takes effect only when Type is set to Media. You can select a specific file within the media asset as an output.
Supported placeholders:

  • {MediaId}: the ID of the media asset.
  • {JobId}: the ID of the transcoding subjob.
  • {MediaBucket}: the bucket to which the media asset belongs.
  • {ExtName}: the file suffix, which uses the output format of the transcoding template.
  • {DestMd5}: the MD5 value of the transcoded output file.
    Notes:
  1. This parameter must contain the {MediaId} and {JobId} placeholders.
  2. The output bucket is the same as the bucket to which the media asset belongs.
oss://bucket/path/to/{MediaId}/{JobId}.mp4
UserDatastring

The user data.

user-data
ScheduleConfigobject

The scheduling information about the job.

PipelineIdstring

The ID of the MPS queue to which the job was submitted.

e37ebee5d98b4781897f6086e89f9c56
Priorityinteger

The priority of the job. Valid values: 1 to 10. The greater the value, the higher the priority.

5
Statusstring

The state of the transcoding job. Valid values:

  • Init: The job is submitted.
  • Processing: The job is in progress.
  • Success: The job is successful.
  • Fail: The job failed.
  • Deleted: The job is deleted.
Init
OutFileMetaobject

The media information about the video generated by the job.

FileBasicInfoobject

The basic file information.

MediaIdstring

The ID of the media asset.

73e07de0f77171eca3fc7035d0b26402
FileNamestring

The file name.

file.m3u8
FileStatusstring

The state of the file.

Normal
FileTypestring

The file type. Valid values: source_file and transcode_file.

source_file
FileSizestring

The file size. Unit: bytes.

31737
FileUrlstring

The URL of the file.

http://bucket.oss-cn-shanghai.aliyuncs.com/path/to/file.m3u8
Regionstring

The region in which the file resides.

cn-shanghai
FormatNamestring

The name of the video format.

hls,applehttp
Durationstring

The duration of the video. Unit: seconds.

403.039999
Bitratestring

The video bitrate.

888.563
Widthstring

The width of the output video.

848
Heightstring

The height of the output video.

478
AudioStreamInfoListarray<object>

The information about the audio stream.

AudioStreamInfoListobject

The information about the audio stream.

Indexstring

The sequence number of the stream.

1
CodecNamestring

The encoding format.

aac
CodecLongNamestring

The name of the encoding format.

AAC (Advanced Audio Coding)
CodecTimeBasestring

The time base of the encoder.

1/44100
CodecTagStringstring

The name of the encoder tag.

[15][0][0][0]
CodecTagstring

The encoder tag.

0x000f
SampleFmtstring

The sample format.

fltp
SampleRatestring

The sampling rate. Unit: Hz.

44100
Channelsstring

The number of sound channels.

2
ChannelLayoutstring

The sound channel layout.

stereo
Timebasestring

The time base.

1/90000
StartTimestring

The start time of the stream.

1.473556
Durationstring

The duration of the stream. Unit: seconds.

403.039989
Bitratestring

The bitrate.

0.f
Langstring

The language of the stream.

cn
VideoStreamInfoListarray<object>

The information about the video stream.

VideoStreamInfoListobject

The information about the video stream.

Indexstring

The sequence number of the stream.

0
Codec_namestring

The encoding format.

h264
Codec_long_namestring

The name of the encoding format.

H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Profilestring

The encoder profile.

High
Codec_time_basestring

The time base of the encoder.

1/50
Codec_tag_stringstring

The tag string of the encoding format.

[27][0][0][0]
Codec_tagstring

The tag of the encoding format.

0x001b
Widthstring

The width of the output video.

848
Heightstring

The height of the output video.

478
Has_b_framesstring

Indicates whether the video stream contains bidirectional frames (B-frames). Valid values:

  • 0: The stream contains no B-frames.
  • 1: The stream contains one B-frame.
  • 2: The stream contains multiple consecutive B-frames.
2
Sarstring

The aspect ratio of the area from which the sampling points are collected.

478:477
Darstring

The display aspect ratio.

16:9
PixFmtstring

The pixel format.

yuv420p
Levelstring

The codec level.

31
Fpsstring

The frame rate.

25.0
Avg_fpsstring

The average frame rate.

25.0
Time_basestring

The time base.

1/90000
Start_timestring

The start time of the stream.

1.473556
Durationstring

The duration of the stream. Unit: seconds.

403.039989
Bit_ratestring

The bitrate.

888.563
NumFramesstring

The total number of frames.

10040
Langstring

The language of the stream.

cn
Rotatestring

The rotation angle of the video image. Valid values: 0, 90, 180, and 270. Default value: 0.

0
SubmitResultJsonobject

The job submission result.

{}
SubmitTimestring

The time when the job was submitted.

2022-01-12T08:49:41Z
FinishTimestring

The time when the job was complete.

2022-01-12T08:49:41Z
RequestIdstring

The ID of the request that submitted the job.

31E30781-9495-5E2D-A84D-759B0A01E262
CreateTimestring

The time when the job was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-01-12T08:49:41Z
Namestring

The job name.

transcode-job
RequestIdstring

The ID of the request that submitted the job.

31E30781-9495-5E2D-A84D-759B0A01E262
ParentJobIdstring

The main job ID.

8b2198504dd340b7b3c9842a74fc9baa
JobCountinteger

The number of subjobs.

1
Statusstring

The state of the job. Success: At least one of the subjobs is successful. Fail: All subjobs failed.

Success
TriggerSourcestring

The source of the job. Valid values: API, WorkFlow, and Console.

API
Percentinteger

The completion percentage of the job.

0
SubmitTimestring

The time when the job was submitted. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-01-12T08:49:41Z
FinishTimestring

The time when the job was complete. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-01-12T08:49:41Z
InputGrouparray<object>

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.

InputGroupobject

The information about the job input.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
OutputGrouparray<object>

The output group of the job.

OutputGroupobject

The output of the job.

Outputobject

The output file configuration.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
ProcessConfigobject

The job processing configuration.

Transcodeobject

The transcoding configuration.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Videoobject

The video settings.

Codecstring

The encoding format.

H.264
Profilestring

The encoding profile. Valid values: baseline, main, and high.

  • baseline: applicable to mobile devices.
  • main: applicable to standard-definition devices.
  • high: applicable to high-definition devices.

Default value: high.

Main
Bitratestring

The average bitrate of the video.

  • Valid values: [10,50000].
  • Unit: Kbit/s.
3000
Crfstring

The constant rate factor.

  • Valid values: [0,51].
  • Default value: 23 if the encoding format is H.264, or Default value when the Codec parameter is set to H.265: 26.

If this parameter is specified, the value of Bitrate becomes invalid.

23
Widthstring

The width of the output video.

  • Valid values: [128,4096].
  • Unit: pixels.
  • Default value: the width of the input video.
1920
Heightstring

The height of the output video.

  • Valid values: [128,4096].
  • Unit: pixels.
  • Default value: the height of the input video.
1080
Fpsstring

The frame rate.

  • Valid values: (0,60].
  • The value is 60 if the frame rate of the input video exceeds 60.
  • Default value: the frame rate of the input video.
25
Gopstring

The maximum number of frames between two keyframes.

  • Valid values: [1,1080000].
  • Default value: 250.
250
Presetstring

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
ScanModestring

The scan mode. Valid values: interlaced and progressive.

progressive
PixFmtstring

The pixel format of the video. Valid values: standard pixel formats such as yuv420p and yuvj420p.

yuv420p
Removestring

Specifies whether to remove the video.

false
Cropstring

The method of video cropping. Valid values:

  • border: automatically detects and removes black bars.
  • A value in the width:height:left:top format: crops the videos based on the custom settings. Example: 1280:800:0:140.
1280:800:0:140
Padstring

The black bars added to the video.

  • Format: width:height:left:top.
  • Example: 1280:800:0:140.
1280:800:0:140
LongShortModestring

Specifies whether to enable the auto-rotate screen feature.

false
Bufsizestring

The buffer size.

  • Valid values: [1000,128000].
  • Default value: 6000.
  • Unit: KB.
6000
Maxratestring

The maximum bitrate of the output video.

  • Valid values: [10,50000].
  • Unit: Kbit/s.
9000
AbrMaxstring

The maximum ABR. This parameter takes effect only for Narrowband HD 1.0.

  • Valid values: [10,50000].
  • Unit: Kbit/s.
6000
Audioobject

The audio settings.

Codecstring

The audio codec. Valid values: AAC, MP3, VORBIS, and FLAC. Default value: AAC.

AAC
Profilestring

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
Sampleratestring

The sampling rate.

  • Valid values: 22050, 32000, 44100, 48000, and 96000. Default value: 44100.
  • Unit: Hz.
44100
Bitratestring

The audio bitrate of the output file.

  • Valid values: [8,1000].
  • Unit: Kbit/s.
  • Default value: 128.
128
Channelsstring

The number of sound channels. Default value: 2.

2
Removestring

Specifies whether to delete the audio stream.

false
Volumeobject

The volume configurations.

Methodstring

The volume adjustment method. Valid values:

auto
IntegratedLoudnessTargetstring

The output volume.

-6
TruePeakstring

The peak volume.

-1
LoudnessRangeTargetstring

The volume range.

8
Containerobject

The encapsulation format settings.

Formatstring

The container format.

mp4
MuxConfigobject

The encapsulation settings.

Segmentobject

The segment settings.

Durationstring

The segment length.

10
ForceSegTimestring

The forced segmentation point in time.

2,3
TransConfigobject

The conditional transcoding configurations.

TransModestring

The video transcoding mode. Valid values:

  • onepass: You can set this parameter to onepass if the Bitrate parameter is set to ABR. The encoding speed of this mode is faster than that of the twopass mode.
  • twopass: You can set this parameter to twopass if the Bitrate parameter is set to VBR. The encoding speed of this mode is slower than that of the onepass mode.
  • CBR: the constant bitrate mode.

Default value: onepass.

onepass
IsCheckResostring

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:

  • true: checks the video resolution. If the width or height of the input video is less than that of the output video, the resolution of the input video is used for transcoding.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckResoFailstring

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:

  • true: checks the video resolution. If the width or height of the input video is less than that of the output video, the transcoding job fails.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckVideoBitratestring

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:

  • true: checks the video resolution. If the bitrate of the input video is less than that of the output video, the bitrate of the input video is used for transcoding.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckVideoBitrateFailstring

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:

  • true: checks the video resolution. If the bitrate of the input video is less than that of the output video, the transcoding job fails.
  • false: does not check the video resolution.

Default value: false.

true
IsCheckAudioBitratestring

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:

  • true: checks the video resolution. If the bitrate of the input audio is less than that of the output audio, the bitrate of the input audio is used for transcoding.
  • false: does not check the video resolution.

Default value:

  • If this parameter is not specified and the codec of the output audio is different from that of the input audio, the default value is false.
  • If this parameter is not specified and the codec of the output audio is the same as that of the input audio, the default value is true.
true
IsCheckAudioBitrateFailstring

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:

  • true: checks the video resolution. If the bitrate of the input audio is less than that of the output audio, the transcoding job fails.
  • false: does not check the video resolution.

Default value: false.

true
AdjDarMethodstring

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
ImageWatermarksarray<object>

The watermark configuration of an image.

ImageWatermarkobject

The watermark configuration of an image.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Widthstring

The width of the watermark in the output video. The following value types are supported:

  • Integer: the pixel value of the watermark width.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the watermark width to the width of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
32
Heightstring

The height of the watermark image in the output video. The following value types are supported:

  • Integer: the pixel value of the watermark height.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the watermark height to the height of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
32
Dxstring

The horizontal offset of the watermark relative to the output video. Default value: 0.

The following value types are supported:

  • Integer: the pixel value of the horizontal offset.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the horizontal offset to the width of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
10
Dystring

The vertical offset of the watermark relative to the output video. Default value: 0.

The following value types are supported:

  • Integer: the pixel value of the horizontal offset.

    • Valid values: [8,4096].
    • Unit: pixels.
  • Decimal: the ratio of the vertical offset to the height of the output video.

    • Valid values: (0,1).
    • The decimal number can be accurate to four decimal places, such as 0.9999. Excessive digits are automatically discarded.
10
ReferPosstring

The position of the watermark.

  • Valid values: TopRight, TopLeft, BottomRight, and BottomLeft.
  • Default value: TopRight.
TopLeft
Timelineobject

The time settings of the dynamic watermark.

Startstring

The beginning of the time range in which the watermark is displayed.

  • Unit: seconds.
  • Value values: integers.
  • Default value: 0.
00:00:05
Durationstring

The time range in which the watermark is displayed.

  • Valid values: integers and ToEND.
  • Default value: ToEND.
ToEND
Fileobject

The watermark image file.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object.

  • If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, set this parameter to the ID of a media asset.
oss://bucket/path/to/video.mp4
TextWatermarksarray<object>

The configurations of the text watermark.

TextWatermarkobject

The configurations of the text watermark.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Contentstring

The watermark text. Base64 encoding is not required. The string must be encoded in UTF-8.

FontNamestring

The font of the text. Default value: SimSun.

SimSun
FontColorstring

The color of the text.

#006400
FontAlphastring

The transparency of the text.

  • Valid values: (0,1].
  • Default value: 1.
1.0
Topstring

The top margin of the text.

  • Default value: 0.
  • Valid values: [0,4096].
10
Leftstring

The left margin of the text watermark.

  • Default value: 0.
  • Valid values: [0,4096].
10
FontSizeinteger

The size of the text.

  • Default value: 16.
  • Valid values: (4,120).
16
BorderWidthinteger

The outline width of the text watermark.

  • Default value: 0.
  • Valid values: (0,4096].
0
BorderColorstring

The outline color of the text watermark. Default value: black. For more information, see BorderColor.

#006400
Adaptivestring

Specifies whether to the font size based on the output video dimensions.

  • true: false
  • default: false
false
Subtitlesarray<object>

The subtitle configuration.

Subtitleobject

The subtitle configuration.

TemplateIdstring

The template ID.

9547c6ad97cb4f2aaa29683ebd18d410
OverwriteParamsobject

The parameters that are used to overwrite the corresponding parameters of the template.

Formatstring

The format of the subtitle file.

vtt
CharEncstring

The file encoding format.

UTF-8
Fileobject

The subtitle file.

Typestring

The type of the media object. Valid values:

  • OSS: an OSS object.
  • Media: a media asset.
OSS
Mediastring

The media object. If Type is set to OSS, set this parameter to the URL of an OSS object. Both the OSS and HTTP protocols are supported. If Type is set to Media, set this parameter to the ID of a media asset.

oss://bucket/path/to/video.mp4
Encryptionobject

The encryption settings.

EncryptTypestring

Specifies the encryption type.

PrivateEncryption
CipherTextstring

The ciphertext of HLS encryption.

MTYi00NDU0LTg5O****
DecryptKeyUristring

The address of the decryption service for HLS encryption.

https://sample.com/path?CipherText=MTYi00NDU0LTg5O****
KeyServiceTypestring

The type of the key service. Valid values: KMS and Base64.

KMS
CombineConfigsarray<object>

The multi-input stream merge configuration.

CombineConfigobject

The multi-input stream merge configuration.

AudioIndexstring

The audio stream index.

VideoIndexstring

The video stream index.

Startdouble

The start time of the input stream. Default value: 0.

0.0
Durationdouble

The duration of the input stream. The default value is the duration of the video.

20.0
UserDatastring

The user data.

user-data
ScheduleConfigobject

The scheduling configuration of the job.

PipelineIdstring

The ID of the MPS queue to which the job was submitted.

e37ebee5d98b4781897f6086e89f9c56
Priorityinteger

The priority of the job. Valid values: 1 to 10. The greater the value, the higher the priority.

5

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2023-11-07The response structure of the API has changedView Change Details
2023-10-18The response structure of the API has changedView Change Details
2023-10-10The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-06-06The response structure of the API has changedView Change Details
2023-05-18The response structure of the API has changedView Change Details
2022-09-20The response structure of the API has changedView Change Details
2022-08-10The internal configuration of the API is changed, but the call is not affectedView Change Details
2022-07-11Add OperationView Change Details