All Products
Search
Document Center

Intelligent Media Services:GetTranscodeJob

Last Updated:Dec 16, 2024

Queries the information about 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:GetTranscodeJob
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ParentJobIdstringYes

The job ID.

ab4802364a2e49208c99efab82dfa8e8

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

9EDC30DC-0050-5459-B788-F761B2BE359B
TranscodeParentJobobject

TranscodeParentJobWithSubJobDTO

TranscodeJobListarray<object>

The list of subjobs.

TranscodeJobListobject

The subjob.

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 Object Storage Service (OSS) object.
  • Media: a media asset.
OSS
Mediastring

The media object.

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

The URL of the media asset. This parameter is specified only when the media asset is transcoded.

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 26 if the encoding format is H.265.

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

Indicates whether the video was removed.

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.
1280:800:0:140
Padstring

The black bars added to the video. Format: width:height:left:top.

1280:800:0:140
LongShortModestring

Indicates whether the auto-rotate screen feature is enabled.

false
Bufsizestring

The buffer size.

  • Valid values: [1000,128000].
  • Default value: 6000.
  • Unit: Kbit/s.
6000
Maxratestring

The maximum bitrate of the output video.

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

The maximum adaptive bitrate (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

Indicates whether the audio stream is deleted.

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

Indicates whether the video resolution was checked. You can specify only one of the IsCheckReso and IsCheckResoFail parameters. The priority of the IsCheckResoFail parameter is higher. Valid values:

  • true 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

Default value: false.

true
IsCheckResoFailstring

Indicates whether the video resolution was checked. You can specify only one of the IsCheckReso and IsCheckResoFail parameters. The priority of the IsCheckResoFail parameter is higher. Valid values:

  • true If the width or height of the input video is less than that of the output video, the transcoding job fails.
  • false

Default value: false.

true
IsCheckVideoBitratestring

Indicates whether the video bitrate was checked. You can specify only one of the IsCheckVideoBitrate and IsCheckVideoBitrateFail parameters. The priority of the IsCheckVideoBitrateFail parameter is higher. Valid values:

  • true 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

Default value: false.

true
IsCheckVideoBitrateFailstring

Indicates whether the video bitrate was checked. You can specify only one of the IsCheckVideoBitrate and IsCheckVideoBitrateFail parameters. The priority of the IsCheckVideoBitrateFail parameter is higher. Valid values:

  • true If the bitrate of the input video is less than that of the output video, the transcoding job fails.
  • false

Default value: false.

true
IsCheckAudioBitratestring

Indicates whether the audio bitrate was checked. You can specify only one of the IsCheckAudioBitrate and IsCheckAudioBitrateFail parameters. The priority of the IsCheckAudioBitrateFail parameter is higher. Valid values:

  • true 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

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

Indicates whether the audio bitrate was checked. You can specify only one of the IsCheckAudioBitrate and IsCheckAudioBitrateFail parameters. The priority of the IsCheckAudioBitrateFail parameter is higher. Valid values:

  • true If the bitrate of the input audio is less than that of the output audio, the transcoding job fails.
  • false

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.

For more information about examples, see How do I set the resolution for an output video?

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 output video.

32
Heightstring

The height of the output video.

32
Dxstring

The position of the watermark on the x-axis.

10
Dystring

The position of the watermark on the y-axis.

10
ReferPosstring

The reference position of the watermark. Valid values: TopLeft, TopRight, BottomLeft, and BottomRight. Default value: TopLeft.

TopLeft
Timelineobject

The timeline settings.

Startstring

The start time of the stream.

00:00:05
Durationstring

The duration of the stream. Valid values: the number of seconds or "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, the URL of an OSS object is returned. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, the ID of a media asset is returned.
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.

SimSun
FontColorstring

The color of the text.

#006400
FontAlphastring

The transparency of the watermark.

1.0
Topstring

The distance of the watermark from the top edge.

10
Leftstring

The distance of the watermark from the left edge.

10
FontSizeinteger

The size of the text.

16
BorderWidthinteger

The border width.

0
BorderColorstring

The border color.

#006400
Adaptivestring

Indicates whether the text size was adjusted based on the output video dimensions. Valid values: true and false. Default value: 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, the URL of an OSS object is returned. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, the ID of a media asset is returned.
oss://bucket/path/to/video.mp4
Encryptionobject

The encryption settings.

EncryptTypestring

The encryption type.

PrivateEncryption
CipherTextstring

The ciphertext of HTTP Live Streaming (HLS) encryption.

MTYi00NDU0LTg5O****
DecryptKeyUristring

The endpoint 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
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
IsInheritTagsboolean

Indicates whether the tags of the input stream are inherited in the output stream. This parameter does not take effect when the input is not a media asset. Default value: false.

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

The path of the transcoded output stream. This parameter is required only when the output is a media asset.

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 ApsaraVideo Media Processing (MPS) queue to which the snapshot 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), Success (the job is successful), Fail (the job failed), and 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.

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

The URL of the output stream.

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 26 if the encoding format is H.265.
  • 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

Indicates whether the video was removed.

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

Indicates whether the auto-rotate screen feature is enabled.

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

Indicates whether the audio stream is deleted.

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

Indicates whether the video resolution was checked. You can specify only one of the IsCheckReso and IsCheckResoFail parameters. The priority of the IsCheckResoFail parameter is higher. Valid values:

  • true 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

Default value: false.

true
IsCheckResoFailstring

Indicates whether the video resolution was checked. You can specify only one of the IsCheckReso and IsCheckResoFail parameters. The priority of the IsCheckResoFail parameter is higher. Valid values:

  • true If the width or height of the input video is less than that of the output video, the transcoding job fails.
  • false

Default value: false.

true
IsCheckVideoBitratestring

Indicates whether the video bitrate was checked. You can specify only one of the IsCheckVideoBitrate and IsCheckVideoBitrateFail parameters. The priority of the IsCheckVideoBitrateFail parameter is higher. Valid values:

  • true 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

Default value: false.

true
IsCheckVideoBitrateFailstring

Indicates whether the video bitrate was checked. You can specify only one of the IsCheckVideoBitrate and IsCheckVideoBitrateFail parameters. The priority of the IsCheckVideoBitrateFail parameter is higher. Valid values:

  • true If the bitrate of the input video is less than that of the output video, the transcoding job fails.
  • false

Default value: false.

true
IsCheckAudioBitratestring

Indicates whether the audio bitrate was checked. You can specify only one of the IsCheckAudioBitrate and IsCheckAudioBitrateFail parameters. The priority of the IsCheckAudioBitrateFail parameter is higher. Valid values:

  • true 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

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

Indicates whether the audio bitrate was checked. You can specify only one of the IsCheckAudioBitrate and IsCheckAudioBitrateFail parameters. The priority of the IsCheckAudioBitrateFail parameter is higher. Valid values:

  • true If the bitrate of the input audio is less than that of the output audio, the transcoding job fails.
  • false

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 output video.

32
Heightstring

The height of the output video.

32
Dxstring

The position of the watermark on the x-axis.

10
Dystring

The position of the watermark on the y-axis.

10
ReferPosstring

The reference position of the watermark. Valid values: TopLeft, TopRight, BottomLeft, and BottomRight. Default value: TopLeft.

TopLeft
Timelineobject

The timeline settings.

Startstring

The start time of the stream.

00:00:05
Durationstring

The duration of the stream. Valid values: the number of seconds or "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, the URL of an OSS object is returned. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, the ID of a media asset is returned.
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.

SimSun
FontColorstring

The color of the text.

#006400
FontAlphastring

The transparency of the watermark.

1.0
Topstring

The distance of the watermark from the top edge.

10
Leftstring

The distance of the watermark from the left edge.

10
FontSizeinteger

The size of the text.

16
BorderWidthinteger

The border width.

0
BorderColorstring

The border color.

#006400
Adaptivestring

Indicates whether the text size was adjusted based on the output video dimensions. Valid values: true and false. Default value: 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, the URL of an OSS object is returned. Both the OSS and HTTP protocols are supported.
  • If Type is set to Media, the ID of a media asset is returned.
oss://bucket/path/to/video.mp4
Encryptionobject

The encryption settings.

EncryptTypestring

The encryption type.

PrivateEncryption
CipherTextstring

The ciphertext of HLS encryption.

MTYi00NDU0LTg5O****
DecryptKeyUristring

The endpoint 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
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 ApsaraVideo Media Processing (MPS) queue to which the snapshot 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": "9EDC30DC-0050-5459-B788-F761B2BE359B",
  "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"
          }
        ],
        "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"
              },
              "Tags": {
                "key": ""
              }
            }
          },
          "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
            }
          ],
          "IsInheritTags": true
        },
        "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": "486c2890096871edba6f81848c016303",
            "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",
          "OutputUrl": "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
            }
          ]
        }
      }
    ],
    "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
2024-02-20The 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-07-11Add OperationView Change Details