SubmitJobs

Updated at:

Submits a transcoding job. When the transcoding tasks and workflows created in the console cannot meet your business scenarios, you can call the SubmitJobs operation to perform transcoding as needed. Configure the required transcoding parameters based on your business logic.

Operation description

  • A transcoding job is an asynchronous job, and its completion time is not guaranteed. After you submit a transcoding job, the job is added to an ApsaraVideo Media Processing (MPS) queue for scheduling and execution. Therefore, when the operation returns, transcoding may not be complete. After the job completes, call the Query transcoding jobs operation to poll the execution result, or attach a Message Service (MNS) message to the MPS queue to receive the execution result. For more information, see Receive message notifications.

  • The maximum size of a single input file is 100 GB. If the size exceeds 100 GB, the job may fail.

  • To transcode an input file by using a preset intelligent template, you must first call the operation that submits a preset template analysis job (SubmitAnalysisJob). After the analysis job succeeds, you can call the operation that queries template analysis jobs (QueryAnalysisJobList) to obtain the list of available preset templates for the input file. When you submit a transcoding job, the TemplateId parameter Settings must be an available preset template ID. If the template specified in the submitted transcoding job is not in the list of available preset templates, the transcoding job fails.

  • To transcode an input file by using a preset static template, you do not need to submit a template analysis job.

  • If you need to use multiple accounts in MPS, you can create a Resource Access Management (RAM) user for your Alibaba Cloud account and grant permissions to the user. For more information, see Create a RAM user and grant permissions. If you use different Alibaba Cloud accounts to submit and query a transcoding job, the query returns no data.

  • If your account has an overdue payment, the service is paused within 24 hours after the payment becomes overdue. For more information, see Overdue payments.

  • For more frequently asked questions about transcoding, see ApsaraVideo Media Processing FAQ.

QPS limit

The single-user queries per second (QPS) limit for this operation is 100 requests per second. If you exceed this limit, API calls are throttled. This may affect your business. Call this operation as needed. For more information, see QPS limit.

Try it now

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

Test

RAM authorization

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

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

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

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

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

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

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

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

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

Action

Access level

Resource type

Condition key

Dependent action

mts:SubmitJobs

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Input

string

Yes

The job input. For more information, see Input details.

Note
  • In ApsaraVideo Media Processing (MPS) API operations, an object must be URL-encoded in UTF-8 before it is used.

  • The region of the OSS bucket must be the same as the region where MPS is deployed.

{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"example.flv","Referer": "OSS anti-theft chain parameters set by the user in the OSS console"}

Outputs

string

Yes

The job output configurations. For more information, see Output details.

  • Outputs is a JSON array of Output objects. The maximum size is 30.

[{"OutputObject":"exampleOutput.mp4","TemplateId":"6181666213ab41b9bc21da8ff5ff****","WaterMarks":[{"InputFile":{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"image_01.png"},"WaterMarkTemplateId":"9b772ce2740d4d55876d8b542d47****"}],"UserData":"testid-001"}]

OutputBucket

string

Yes

The OSS bucket where the output file is stored.

  • The bucket must comply with OSS bucket definitions. For more information, see Terms.

exampleBucket

OutputLocation

string

No

The region (OSS region) of the OSS bucket where the output file is stored.

  • The OSS bucket must be in the same region as ApsaraVideo Media Processing.

  • The bucket must comply with OSS bucket definitions. For more information, see Terms.

oss-cn-hangzhou

PipelineId

string

Yes

The ApsaraVideo Media Processing (MPS) queue ID. For more information, see Terms.

  • You can view the ID in the MPS console by choosing Global Settings > MPS queues and callbacks.

  • If you need asynchronous notifications, attach a Message Service (MNS) message to the MPS queue. For more information, see Receive message notifications.

dd3dae411e704030b921e52698e5****

Response elements

Element

Type

Description

Example

object

The response parameters.

JobResultList

object

JobResult

array<object>

The list of submitted transcoding job results.

array<object>

The job result.

Code

string

The error code returned when the job fails to be created. This parameter is not returned if the job is created.

InvalidParameter.NullValue

Job

object

The job details. If the submission fails, no job ID is generated.

Code

string

The error code returned when transcoding fails. This parameter is not returned if transcoding succeeds.

InternalError

CreationTime

string

The time when the job was added. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format.

2014-01-10T12:00:00Z

FinishTime

string

The time when the job was completed. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format.

2014-01-10T12:20:00Z

Input

object

The job input.

Bucket

string

The OSS bucket of the job input.

example-bucket-****

Location

string

The OSS location of the job input.

oss-cn-hangzhou

Object

string

The OSS object of the job input.

example.flv

JobId

string

The job ID.

31fa3c9ca8134f9cec2b4b0b0f78****

MNSMessageResult

object

The message result of Message Service (MNS) notifying the user of job completion.

ErrorCode

string

The error code returned when the notification fails. This parameter is not returned if the notification succeeds.

InvalidParameter.ResourceNotFound

ErrorMessage

string

The error message returned when the notification fails. This parameter is not returned if the notification succeeds.

The resource operated "%s" cannot be found.

MessageId

string

The ID of the error message returned when the job failed due to a fault. This parameter is not returned if the job succeeds.

123

Message

string

The message returned when transcoding fails. This parameter is not returned if transcoding succeeds.

The operation has failed due to some unknown error, exception or failure.

Output

object

The job output.

AmixList

object

Amix

array<object>

The audio mixing list.

object

The job result.

AmixURL

string

The background audio track media to be mixed. Valid values: an OSS URL or the string "input". The "input" value is used to merge two audio tracks of the same video.

https://outpu***.oss-cn-shanghai.aliyuncs.com/mp4-to-mp3%5E1571025263578816%40.mp3

Duration

string

The duration. The value can be a number or a time format.

20

Map

string

The target audio track selected from AmixURL. The value format is 0:a:{audio_index}, such as 0:a:0.

0:a:0

MixDurMode

string

The media duration mode. Valid values:

  • first: The duration of the output media is the same as that of the input media.

  • long: The duration of the output media is the same as the longer duration of the two input media files. Default value: long.

long

Start

string

The start time. The value can be a number or a time format, such as "1:25:36.240" or "32000.23".

0

Audio

object

The audio configurations.

Note

If audio configurations are specified in the request parameters, they override the corresponding parameters in the specified transcoding template.

Bitrate

string

The audio bitrate of the output file.

  • Unit: Kbit/s.

  • Default value: 128.

128

Channels

string

The number of sound channels.

  • If Codec is set to mp3, only 1 and 2 are supported.

  • If Codec is set to aac, only 1, 2, 4, 5, 6, and 8 are supported.

  • Default value: 2.

6

Codec

string

The audio codec format.

  • Valid values: aac, mp3, vorbis, and flac.

  • Default value: aac.

aac

Profile

string

The audio encoding profile.

Note

If Codec is set to aac, valid values are aac_low, aac_he, aac_he_v2, aac_ld, and aac_eld.

aac_low

Qscale

string

The audio quality control factor.

15

Samplerate

string

The sampling rate.

  • Valid values: 22050, 32000, 44100, 48000, and 96000.

  • Unit: Hz.

  • Default value: 44100.

Note

If the video container format is flv and the audio codec format is mp3, the sampling rates 32000, 48000, and 96000 are not supported. If the audio codec format is mp3, the sampling rate 96000 is not supported.

32000

Volume

object

The volume control settings.

Level

string

The volume adjustment level.

  • Unit: dB.

  • Default value: -20dB.

-20

Method

string

The volume adjustment method. Valid values:

  • auto: Automatic adjustment.

  • dynamic: Dynamic adjustment.

  • linear: Linear adjustment.

auto

AudioStreamMap

string

The audio stream index.

  • Format: 0:a:{index}. Example: 0:a:0.

  • The index represents the subscript of the audio stream list, starting from 0.

  • If this parameter is not set, the default audio stream is selected.

0:a:0

Clip

object

The clip.

TimeSpan

object

The time span of the clip.

Duration

string

The duration.

  • Format: hh:mm:ss[.SSS] or sssss[.SSS].

  • Valid values: [00:00:00.000,23:59:59.999] or [0.000,86399.999].

01:00:59.999

Seek

string

The start time.

  • Format: hh:mm:ss[.SSS] or sssss[.SSS].

  • Valid values: [00:00:00.000,23:59:59.999] or [0.000,86399.999].

01:59:59.999

Container

object

The container.

Format

string

The container format.

  • Default value: mp4.

  • Valid values for video transcoding: flv, mp4, HLS (m3u8+ts), and MPEG-DASH (MPD+fMP4).

  • Valid values for audio transcoding: mp3, mp4, ogg, flac, and m4a.

  • Valid values for images: gif and WEBP.

  • If the container format is gif, VideoCodec must be set to GIF.

  • If the container format is webp, VideoCodec must be set to WEBP.

  • If the container format is flv, VideoCodec cannot be set to H265.

flv

DeWatermark

string

The blurring settings. The value is a JSON object. For more information, see Blurring details in Parameter details.

{"0": [{"l": 10,"t": 10,"w": 10,"h": 10},{"l": 100,"t": 0.1,"w": 10,"h": 10}],"128000": [],"250000": [{"l": 0.2,"t": 0.1,"w": 0.01,"h": 0.05}]}

DigiWaterMark

object

The digital watermarking.

Alpha

string

The transparency of the text or image.

  • Valid values: (0,1].

  • Default value: 1.0.

1.0

InputFile

object

The input file.

Bucket

string

The OSS bucket of the input file.

example-bucket-****

Location

string

The OSS location of the input file.

oss-cn-hangzhou

Object

string

The OSS object of the input file.

example-intput.flv

Type

string

The watermark type. If the watermark type is set, this value overrides the corresponding parameter in the watermark template. Valid values:

  • Image: Image watermark. This is the default value.

  • Text: Text watermark.

Image

Encryption

object

The data encryption settings. Only m3u8 output format is supported.

Id

string

The encryption ID.

31fa3c9ca8134f9cec2b4b0b0f78****

Key

string

The key used to encrypt the video.

encryptionkey128

KeyType

string

The key cannot be transmitted to ApsaraVideo Media Processing (MPS) in plaintext and must be encrypted by using Base64 or Key Management Service (KMS). For example, if the key is "encryptionkey128", use Base64("encryptionkey128") or KMS(Base64("encryptionkey128")).

Base64

KeyUri

string

The access URL of the key, encoded in Base64.

https://1161758785*****.cn-shanghai.fc.aliyuncs.com/2016-08-15/proxy/HLS-decyptServer/decyptServer/

SkipCnt

string

The number of initial segments that are not encrypted to ensure quick video playback.

3

Type

string

The encryption type. Valid value: hls-aes-128.

hls-aes-128

M3U8NonStandardSupport

object

The non-standard M3U8 support settings. The value is a JSON object. For more information, see Non-standard M3U8 parameter support details in Parameter details.

TS

object

The non-standard TS file support settings. The value is a JSON object. For more information, see TS parameter support details in Parameter details.

Md5Support

boolean

Specifies whether to support outputting the MD5 hash value of the TS file in the M3U8 file. Valid values:

  • true: Supported.

  • false: Not supported.

true

SizeSupport

boolean

Specifies whether to support outputting the size of the TS file in the M3U8 file. Valid values:

  • true: Supported.

  • false: Not supported.

true

MergeConfigUrl

string

You can specify only one of the MergeList and MergeConfigUrl parameters.

  • The configuration file specified by MergeConfigUrl supports a maximum of 50 merged segments.

  • MergeConfigUrl is the URL of the merge configuration file.

  • Only configuration files stored in OSS are supported. You must ensure that authorization is granted to MPS and it has the access permissions to the file. For the internal content of the file, see the merge parameter details.

  • Example of the internal content of the mergeConfigfile: {"MergeList":[{"MergeURL":"http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/video_01.mp4"}]}.

`{"MergeList":[{"MergeURL":"http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/video_01.mp4"}]}

MergeList

object

Merge

array<object>

The video merge configurations.

object

The detailed video merge configurations.

Duration

string

The duration.

  • Format: hh:mm:ss[.SSS] or sssss[.SSS].

  • Example: 01:59:59.999 or 32000.23.

00000.20

MergeURL

string

The URL of the merged segment.

  • Example: http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/example-object-****.flv

  • The object must be URL-encoded in UTF-8.

http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/example-object-****.flv

RoleArn

string

The RAM role used for authorization.

acs:ram:::role/

Start

string

The start time.

  • Format: hh:mm:ss[.SSS] or sssss[.SSS].

  • Example: 01:59:59.999 or 32000.23.

00000.50

MuxConfig

object

The transcoding muxing configurations. If this parameter is set in the request parameters, it overrides the corresponding parameter in the specified transcoding template.

Gif

object

The muxing configurations for GIF.

DitherMode

string

The palette color dithering method. Valid values: sierra and bayer.

bayer

FinalDelay

string

The pause time of the final frame. Unit: centiseconds.

0

IsCustomPalette

string

Specifies whether to use a custom palette. Valid values:

  • true: Custom palette.

  • false: Non-custom palette.

false

Loop

string

The number of loops.

0

Segment

object

The segment configurations. The value is a JSON object.

Duration

string

The segment duration. The value is an integer. Unit: seconds.

  • Valid values: [1,10].

  • Default value: 10.

20

Webp

object

The muxing configurations for WebP.

Loop

string

The number of loops.

0

OpeningList

object

Opening

array<object>

The opening list. The value is a JSON object.

object

The job result.

Height

string

The height.

  • Valid values: 0 to 4096, -1, and full.

  • Default value: -1.

  • -1 indicates the value of the source video.

  • full indicates filling the screen.

1080

Start

string

The start time relative to the main video. The delay before the opening video is displayed, starting from 0.

  • Unit: seconds.

  • Default value: 0.

1

Width

string

The width.

  • Valid values: 0 to 4096, -1, and full.

  • Default value: -1.

  • -1 indicates the value of the source video.

  • full indicates filling the screen.

1920

openUrl

string

The OSS URL of the opening video.

http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv

OutSubtitleList

object

OutSubtitle

array<object>

The list of output captions.

array<object>

The details of the output caption.

Map

string

The video track. Format: 0:{stream}:{stream_index}, which is 0:v:{video_index}. The stream value is v for video stream. The index indicates the subscript of the video stream list, starting from 0.

0:v:0

Message

string

The error message returned when the job fails to be created. This parameter is not returned when the job is created successfully.

The specified parameter “%s” cannot be null.

OutSubtitleFile

object

The details of the output file.

Bucket

string

The OSS bucket of the input file.

example-bucket-****

Location

string

The OSS location of the output file.

oss-cn-hangzhou

Object

string

The OSS object of the output file.

example-output.flv

RoleArn

string

The RAM role used for authorization.

acs:ram:::role/

Success

boolean

Indicates whether the job is successful. Valid values:

  • true: The job is successful.

  • false: The job fails.

true

OutputFile

object

The output file.

Bucket

string

The OSS bucket of the input file.

example-bucket-****

Location

string

The OSS location of the output file.

oss-cn-hangzhou

Object

string

The OSS object of the output file.

example-output.flv

RoleArn

string

The RAM role used for authorization.

acs:ram:::role/

Priority

string

The priority of the job in its corresponding MPS queue.

  • Highest priority: 10.

  • Default value: 6.

5

Properties

object

The media properties.

Bitrate

string

The bitrate.

1000

Duration

string

The duration.

55

FileFormat

string

The file format.

QuickTime / MOV

FileSize

string

The file size.

3509895

Format

object

The format information.

Bitrate

string

The total bitrate.

1000

Duration

string

The total duration.

55

FormatLongName

string

The long name of the container or packaging format.

QuickTime / MOV

FormatName

string

The short name of the container or packaging format. Valid values: mov, mp4, m4a, 3gp, 3g2, and mj2.

mov

NumPrograms

string

The total number of program streams.

0

NumStreams

string

The total number of media streams.

2

Size

string

The file size.

3509895

StartTime

string

The start time.

0.000000

Fps

string

The frame rate, as a number.

25

Height

string

The video height.

720

Streams

object

The stream information.

AudioStreamList

object

AudioStream

array<object>

The list of audio streams.

object

The details of the audio stream.

Bitrate

string

The bitrate.

128.806

ChannelLayout

string

The channel output layout.

stereo

Channels

string

The number of channels.

2

CodecLongName

string

The long name of the encoding format.

AAC (Advanced Audio Coding)

CodecName

string

The short name of the encoding format.

aac

CodecTag

string

The encoding format mark.

0x6134706d

CodecTagString

string

The encoding format mark text.

mp4a

CodecTimeBase

string

The codec time base.

1/44100

Duration

string

The duration.

17.159546

Index

string

The index of the audio stream. This indicates the position of the audio stream in all media streams.

1

Lang

string

The language. For more information, see FFmpeg language definitions and ISO-639.

eng

NumFrames

string

The total number of frames.

25

SampleFmt

string

The sample format.

fltp

Samplerate

string

The sample rate.

44100

StartTime

string

The start time.

0.000000

Timebase

string

The time base.

1/44100

SubtitleStreamList

object

SubtitleStream

array<object>

The list of caption streams.

object

The details of the caption stream.

Index

string

The index of the caption stream. This indicates the position of the caption stream in all media streams.

1

Lang

string

The language. For more information, see FFmpeg language definitions and ISO-639.

eng

VideoStreamList

object

VideoStream

array<object>

The list of video streams.

array<object>

The details of the video stream.

AvgFPS

string

The average frame rate.

23.976025

Bitrate

string

The bitrate.

1496.46

CodecLongName

string

The long name of the encoding format.

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

CodecName

string

The short name of the encoding format.

h264

CodecTag

string

The encoding format mark.

0x31637661

CodecTagString

string

The encoding format mark text.

avc1

CodecTimeBase

string

The codec time base.

1001/48000

Dar

string

The display aspect ratio.

16:9

Duration

string

The duration.

17.225542

Fps

string

The frame rate.

23.976025

HasBFrames

string

Indicates whether the video contains B-frames.

2

Height

string

The height of the video resolution.

720

Index

string

The index of the video stream. This indicates the position of the video stream in all media streams.

0

Lang

string

The language. For more information, see FFmpeg language definitions and ISO-639.

eng

Level

string

The encoding level.

51

NetworkCost

object

The network bandwidth consumption.

AvgBitrate

string

The average bitrate.

100

CostBandwidth

string

The maximum consumed bandwidth.

10

PreloadTime

string

The preload time.

8

NumFrames

string

The total number of frames.

25

PixFmt

string

The pixel format.

yuv420p

Profile

string

The encoding profile.

high

Sar

string

The sample aspect ratio.

1:1

StartTime

string

The start time.

0.000000

Timebase

string

The time base.

1/24000

Width

string

The width of the video resolution. The value is a number.

1280

Width

string

The width of the video.

1280

Rotate

string

The clockwise rotation angle of the video.

180

SubtitleConfig

object

The subtitle configuration information.

ExtSubtitleList

object

ExtSubtitle

array<object>

The list of external subtitles. The value is a JSON array that contains up to 4 external subtitles.

array<object>

The details of the external subtitle.

CharEnc

string

The character encoding of the external subtitle. Valid values:

  • UTF-8

  • GBK

  • BIG5

  • auto

Default value: auto.

Note

If you set this parameter to auto, misdetection may occur. Specify a specific character encoding.

UTF-8

FontName

string

The font name used when external subtitles are converted to hard subtitles. Default value: SimSun. For more information about fonts, see Font list.

"WenQuanYi Zen Hei", "Yuanti SC Regular", "SimSun"

Input

object

The external input subtitle file. The value is a JSON object. Only srt and ass formats are supported.

Bucket

string

The OSS bucket where the input file is stored.

example-bucket-****

Location

string

The OSS region where the input file is stored.

oss-cn-hangzhou

Object

string

The OSS object of the input file.

example-output.flv

SubtitleList

object

Subtitle

array<object>

The list of subtitles.

object

The job result.

Map

string

The audio track. Format: 0:{stream}:{stream_index}, which is 0:a:{audio_index}. The stream value is a, which indicates an audio stream. The index indicates the subscript of the audio stream in the audio stream list, starting from 0.

0:a:0

SuperReso

object

Specifies whether the resolution follows the source.

IsHalfSample

string

Specifies whether to obtain sampling rate-related parameters. Valid values:

  • true: yes.

  • false: no.

true

TailSlateList

object

TailSlate

array<object>

The list of tail slates. The value is a JSON object.

object

The job result.

BgColor

string

The background color used to fill the blank space when the width and height of the tail slate video are smaller than those of the main video. Default value: White. For more valid values, see bgcolor.

White

BlendDuration

string

The duration of the transition between the main video and the tail slate video. The transition effect is fade-in and fade-out: the last frame of the main video is displayed while the tail slate video is played. The last frame of the main video gradually darkens, and the tail slate video gradually brightens. Unit: seconds. Default value: 0.

2

Height

string

The height. Valid values:

  • 0 to 4096

  • -1: the height of the source video.

  • full: fills the screen.

Default value: -1.

1080

IsMergeAudio

boolean

Specifies whether to concatenate the audio content of the tail slate video. Valid values:

  • true: concatenates the audio content.

  • false: does not concatenate the audio content.

false

Start

string

The start time.

1

TailUrl

string

The OSS URL of the tail slate video.

http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv

Width

string

The width. Valid values:

  • 0 to 4096

  • -1: the width of the source video.

  • full: fills the screen.

Default value: -1.

1920

TemplateId

string

The ID of the transcoding template.

S00000000-000010

TransConfig

object

The general transcoding configurations.

Note

If this value is set in the request parameter, it overwrites the corresponding Settings in the specified transcoding template.

AdjDarMethod

string

The method used to rewrite the resolution. Default value: none. Valid values:

  • rescale: rescales the resolution.

  • crop: crops the resolution.

  • pad: pads the resolution.

  • none: does not rewrite the resolution.

crop

IsCheckAudioBitrate

string

Specifies whether to check the audio bitrate. If the output audio bitrate is greater than the source audio bitrate, the output audio bitrate is considered equal to the source audio bitrate, and the specified audio bitrate parameter does not take effect. The priority of this parameter is lower than that of IsCheckAudioBitrateFail. Valid values:

  • true: checks the audio bitrate.

  • false: does not check the audio bitrate.

Default values:

  • If this parameter is left empty and the codec is different from that of the input source: false.

  • If this parameter is left empty and the codec is the same as that of the input source: true.

false

IsCheckAudioBitrateFail

string

Specifies whether to check the audio bitrate. The priority of this parameter is higher than that of IsCheckAudioBitrate. If the output audio bitrate is greater than the source audio bitrate, the transcoding job fails and no transcoding is performed. Valid values:

  • false: checks the audio bitrate.

  • true: does not check the audio bitrate.

true

IsCheckReso

string

Specifies whether to check the resolution. If the output resolution is greater than the input resolution in width or height, the output resolution is considered equal to the input resolution. Valid values:

  • true: checks the resolution.

  • false: does not check the resolution.

Default value: false.

false

IsCheckResoFail

string

Specifies whether to check the resolution. The priority of this parameter is higher than that of IsCheckReso. If the output resolution is greater than the input resolution in width or height, the transcoding job fails and no transcoding is performed. Valid values:

  • true: checks the resolution.

  • false: does not check the resolution.

Default value: false.

false

IsCheckVideoBitrate

string

Specifies whether to check the video bitrate. If the output video bitrate is greater than the input video bitrate, the output video bitrate is considered equal to the input video bitrate. Valid values:

  • true: checks the video bitrate.

  • false: does not check the video bitrate.

Default value: false.

false

IsCheckVideoBitrateFail

string

Specifies whether to check the video bitrate. If the output video bitrate is greater than the source video bitrate, the transcoding job fails and no transcoding is performed. The priority of this parameter is higher than that of IsCheckVideoBitrate. Valid values:

  • true: checks the video bitrate.

  • false: does not check the video bitrate.

Default value: false.

true

TransMode

string

The transcoding mode. Valid values:

  • onepass: uses the one-pass algorithm with better accuracy.

  • twopass: uses the two-pass algorithm with lower accuracy.

  • CBR: constant bitrate.

onepass

UserData

string

The custom user data.

example data

Video

object

The video configurations.

Note

If you specify this parameter, it overwrites the AliyunVideoCodec settings in the template specified by TemplateId.

Bitrate

string

The bitrate of the video output file. Unit: Kbps.

10

BitrateBnd

object

The range of the average video bitrate.

Max

string

The upper limit of the total bitrate. Unit: Kbps.

20

Min

string

The lower limit of the total bitrate. Unit: Kbps.

10

Bufsize

string

The buffer size.

  • Unit: Kb.

  • Default value: 6000.

1000

Codec

string

The codec format. Valid values:

  • H.264

  • H.265

  • GIF

  • WEBP

Default value: H.264.

H.264

Crf

string

The constant rate factor (CRF) for bitrate and quality control.

  • If Crf is set, the Bitrate Settings become invalid.

  • Default value: If the encoding format is H.264, the default value is 23. If the encoding format is H.265, the default value is 26.

22

Crop

string

The video cropping settings. Two methods are supported:

  • Automatic detection and cropping of black borders: set the value to border.

  • Custom cropping: the parameter format is width:height:left:top.

1280:800:0:140

Degrain

string

The strength of the independent denoising algorithm.

5

Fps

string

The frame rate.

  • Unit: fps.

  • Valid values: 0 to 60. If the frame rate of the input file exceeds 60, the value 60 is used.

  • Default value: the frame rate of the input file.

60

Gop

string

The maximum time interval or maximum number of frames between keyframes. Unit: seconds.

  • Default value: 10.

  • No unit is used when the value represents the maximum number of frames.

1

Height

string

The height.

  • Unit: pixels.

  • Default value: the original height of the video.

1280

MaxFps

string

The maximum frame rate.

15

Maxrate

string

The peak video bitrate. Unit: Kbps.

10

Pad

string

The video padding settings for black borders.

  • Parameter format: width:height:left:top.

  • Unit: pixels.

1280:800:0:140

PixFmt

string

The video color format.

  • Default value: yuv420p or the original color format.

  • Valid values: standard color formats such as yuv420p and yuvj420p.

    Note

    Non-standard color formats (such as yuvj420p(pc, bt470bg/bt470bg/smpte170m)) require compatibility configurations. Otherwise, the transcoding job fails.

yuvj420p

Preset

string

The video algorithm preset. Default value: medium. Valid values:

  • veryfast: ultra-fast.

  • fast: fast.

  • medium: medium.

  • slow: slow.

  • slower: ultra-slow.

veryfast

Profile

string

The encoding profile. This parameter is supported only for H.264. Default value: high. Valid values:

Note

If you have multiple resolutions, set the lowest resolution to baseline to ensure playback on low-end devices. Set other resolutions to main or high.

  • baseline: for shift devices.

  • main: for standard-resolution devices.

  • high: for high resolution devices.

baseline

Qscale

string

The video quality control value.

15

ResoPriority

string

The resource priority.

1

ScanMode

string

The scan mode. Valid values:

  • Not set: uses the original mode of the input file.

  • auto: automatic deinterlacing.

  • progressive: progressive scan.

  • interlaced: interlaced scan.

  • Default value: empty, which means not set.

Best practices: Although interlaced scan saves more data than progressive scan, the image quality is poor. Therefore, progressive scan is widely used in mainstream video production.

  • If you set the value to progressive or interlaced, but it does not match the original raw mode, the transcoding job fails.

  • To improve compatibility, set the value to the original raw mode or auto.

interlaced

Width

string

The width.

  • Unit: pixels.

  • Default value: the original width of the video.

1080

VideoStreamMap

string

The index of the video stream.

  • Format: 0:a:{index}. Example: 0:a:0.

  • The index indicates the subscript of the audio stream in the audio stream list, starting from 0.

  • If this parameter is not set, the default video stream is selected.

0:a:0

WaterMarkConfigUrl

string

The URL of the watermark configuration file.

http://example.com/configure

WaterMarkList

object

WaterMark

array<object>

The list of watermarks.

Note

If the watermark output is truncated or fails, check whether the text watermark you added contains special characters. If so, escape the special characters before passing them, or submit a ticket to contact Alibaba Cloud technical support for compatibility processing.

array<object>

The details of the watermark.

Dx

string

The horizontal offset of the watermark image relative to the output video. If this value is set in the request parameter, it overwrites the corresponding Settings in the watermark template. Default value: 0. The value can be in one of the following formats:

  • Integer: represents the offset in pixels.
    • Valid values: [8,4096].

    • Unit: pixels.

  • Decimal: represents the ratio of the horizontal offset to the width of the output resolution.
    • Valid values: (0,1).

    • Up to four decimal places are supported, such as 0.9999. The system automatically discards the excess decimal places.

1

Dy

string

The vertical offset of the watermark image relative to the output video. If this value is set in the request parameter, it overwrites the Settings for the vertical offset of the watermark image relative to the output video in the watermark template. The value can be in one of the following formats:

  • Integer: represents the vertical offset of the watermark image relative to the output video in pixels.
    • Valid values: [8,4096].

    • Unit: pixels.

  • Decimal: represents the ratio of the vertical offset of the watermark image relative to the output video.
    • Valid values: (0,1).

    • Up to four decimal places are supported, such as 0.9999. The system automatically discards the excess decimal places.

1

Height

string

The height of the watermark image. If this value is set in the request parameter, it overwrites the Settings for the height of the watermark image in the watermark template. The value can be in one of the following formats:

  • Integer: represents the height of the watermark image in pixels.
    • Valid values: [8,4096].

    • Unit: pixels.

  • Decimal: represents the ratio of the height of the watermark image to the height of the output video resolution.
    • Valid values: (0,1).

    • Up to four decimal places are supported, such as 0.9999. The system automatically discards the excess decimal places.

1280

InputFile

object

The input file for the watermark. PNG images and MOV files are supported as input files.

Bucket

string

The OSS bucket of the input file.

example-bucket

Location

string

The OSS location of the input file.

oss-cn-hangzhou

Object

string

The OSS object of the input file.

example-logo-****.png

ReferPos

string

The position of the watermark. If this value is set in the request parameter, it overwrites the corresponding Settings in the watermark template. Valid values:

  • TopRight: upper right.

  • TopLeft: upper left.

  • BottomRight: lower right.

  • BottomLeft: lower left.

TopRight

Type

string

The type of the watermark. If this parameter is set in the request parameter, this value overwrites the corresponding Settings in the watermark template. For more information, see Parameter details. Valid values:

  • Image: image watermark.

  • Text: text watermark.

Image

WaterMarkTemplateId

string

The ID of the watermark template.

88c6ca184c0e47098a5b665e2a12****

Width

string

The width of the watermark image. If this value is specified in the request parameters, it overwrites the width of the watermark image in the watermark template. The value can be in one of the following formats:

  • Integer: the width of the watermark image in pixels.

    • Valid values: [8, 4096].

    • Unit: px.

  • Decimal: the ratio of the watermark width to the width of the output video resolution.

    • Valid values: (0, 1).

    • Up to four decimal places are supported, such as 0.9999. Extra decimal places are automatically truncated.

1080

Percent

integer

The transcoding progress.

100

PipelineId

string

The ID of the MPS queue.

88c6ca184c0e47098a5b665e2a126797

State

string

The status of the job.

  • Submitted: The job is submitted.

  • TranscodeFail: Transcoding failed.

Submitted

Message

string

The error message returned when the job fails to be created. This parameter is not returned when the job is created successfully.

The specified parameter "%s" cannot be null.

Success

boolean

Indicates whether the job is successful. Valid values:

  • true: The job is successful.

  • false: The job fails.

true

RequestId

string

The ID of the request.

25818875-5F78-4A45S71F6-D73936451234

Examples

Success response

JSON format

{
  "JobResultList": {
    "JobResult": [
      {
        "Code": "InvalidParameter.NullValue",
        "Job": {
          "Code": "InternalError",
          "CreationTime": "2014-01-10T12:00:00Z",
          "FinishTime": "2014-01-10T12:20:00Z",
          "Input": {
            "Bucket": "example-bucket-****",
            "Location": "oss-cn-hangzhou",
            "Object": "example.flv"
          },
          "JobId": "31fa3c9ca8134f9cec2b4b0b0f78****",
          "MNSMessageResult": {
            "ErrorCode": "InvalidParameter.ResourceNotFound",
            "ErrorMessage": "The resource operated \"%s\" cannot be found.",
            "MessageId": "123"
          },
          "Message": "The operation has failed due to some unknown error, exception or failure.",
          "Output": {
            "AmixList": {
              "Amix": [
                {
                  "AmixURL": "https://outpu***.oss-cn-shanghai.aliyuncs.com/mp4-to-mp3%5E1571025263578816%40.mp3",
                  "Duration": "20",
                  "Map": "0:a:0",
                  "MixDurMode": "long",
                  "Start": "0"
                }
              ]
            },
            "Audio": {
              "Bitrate": "128",
              "Channels": "6",
              "Codec": "aac",
              "Profile": "aac_low",
              "Qscale": "15",
              "Samplerate": "32000",
              "Volume": {
                "Level": "-20",
                "Method": "auto"
              }
            },
            "AudioStreamMap": "0:a:0",
            "Clip": {
              "TimeSpan": {
                "Duration": "01:00:59.999",
                "Seek": "01:59:59.999"
              }
            },
            "Container": {
              "Format": "flv"
            },
            "DeWatermark": "{\"0\": [{\"l\": 10,\"t\": 10,\"w\": 10,\"h\": 10},{\"l\": 100,\"t\": 0.1,\"w\": 10,\"h\": 10}],\"128000\": [],\"250000\": [{\"l\": 0.2,\"t\": 0.1,\"w\": 0.01,\"h\": 0.05}]}",
            "DigiWaterMark": {
              "Alpha": "1.0",
              "InputFile": {
                "Bucket": "example-bucket-****",
                "Location": "oss-cn-hangzhou",
                "Object": "example-intput.flv"
              },
              "Type": "Image"
            },
            "Encryption": {
              "Id": "31fa3c9ca8134f9cec2b4b0b0f78****",
              "Key": "encryptionkey128",
              "KeyType": "Base64",
              "KeyUri": "https://1161758785*****.cn-shanghai.fc.aliyuncs.com/2016-08-15/proxy/HLS-decyptServer/decyptServer/",
              "SkipCnt": "3",
              "Type": "hls-aes-128"
            },
            "M3U8NonStandardSupport": {
              "TS": {
                "Md5Support": true,
                "SizeSupport": true
              }
            },
            "MergeConfigUrl": "`{\"MergeList\":[{\"MergeURL\":\"http://exampleBucket****.oss-cn-hangzhou.aliyuncs.com/video_01.mp4\"}]}",
            "MergeList": {
              "Merge": [
                {
                  "Duration": "00000.20",
                  "MergeURL": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/example-object-****.flv",
                  "RoleArn": "acs:ram:::role/",
                  "Start": "00000.50"
                }
              ]
            },
            "MuxConfig": {
              "Gif": {
                "DitherMode": "bayer",
                "FinalDelay": "0",
                "IsCustomPalette": "false",
                "Loop": "0"
              },
              "Segment": {
                "Duration": "20"
              },
              "Webp": {
                "Loop": "0"
              }
            },
            "OpeningList": {
              "Opening": [
                {
                  "Height": "1080",
                  "Start": "1",
                  "Width": "1920",
                  "openUrl": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv"
                }
              ]
            },
            "OutSubtitleList": {
              "OutSubtitle": [
                {
                  "Map": "0:v:0",
                  "Message": "The specified parameter “%s” cannot be null.",
                  "OutSubtitleFile": {
                    "Bucket": "example-bucket-****",
                    "Location": "oss-cn-hangzhou",
                    "Object": "example-output.flv",
                    "RoleArn": "acs:ram:::role/"
                  },
                  "Success": true
                }
              ]
            },
            "OutputFile": {
              "Bucket": "example-bucket-****",
              "Location": "oss-cn-hangzhou",
              "Object": "example-output.flv",
              "RoleArn": "acs:ram:::role/"
            },
            "Priority": "5",
            "Properties": {
              "Bitrate": "1000",
              "Duration": "55",
              "FileFormat": "QuickTime / MOV",
              "FileSize": "3509895",
              "Format": {
                "Bitrate": "1000",
                "Duration": "55",
                "FormatLongName": "QuickTime / MOV",
                "FormatName": "mov",
                "NumPrograms": "0",
                "NumStreams": "2",
                "Size": "3509895",
                "StartTime": "0.000000"
              },
              "Fps": "25",
              "Height": "720",
              "Streams": {
                "AudioStreamList": {
                  "AudioStream": [
                    {
                      "Bitrate": "128.806",
                      "ChannelLayout": "stereo",
                      "Channels": "2",
                      "CodecLongName": "AAC (Advanced Audio Coding)",
                      "CodecName": "aac",
                      "CodecTag": "0x6134706d",
                      "CodecTagString": "mp4a",
                      "CodecTimeBase": "1/44100",
                      "Duration": "17.159546",
                      "Index": "1",
                      "Lang": "eng",
                      "NumFrames": "25",
                      "SampleFmt": "fltp",
                      "Samplerate": "44100",
                      "StartTime": "0.000000",
                      "Timebase": "1/44100"
                    }
                  ]
                },
                "SubtitleStreamList": {
                  "SubtitleStream": [
                    {
                      "Index": "1",
                      "Lang": "eng"
                    }
                  ]
                },
                "VideoStreamList": {
                  "VideoStream": [
                    {
                      "AvgFPS": "23.976025",
                      "Bitrate": "1496.46",
                      "CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
                      "CodecName": "h264",
                      "CodecTag": "0x31637661",
                      "CodecTagString": "avc1",
                      "CodecTimeBase": "1001/48000",
                      "Dar": "16:9",
                      "Duration": "17.225542",
                      "Fps": "23.976025",
                      "HasBFrames": "2",
                      "Height": "720",
                      "Index": "0",
                      "Lang": "eng",
                      "Level": "51",
                      "NetworkCost": {
                        "AvgBitrate": "100",
                        "CostBandwidth": "10",
                        "PreloadTime": "8"
                      },
                      "NumFrames": "25",
                      "PixFmt": "yuv420p",
                      "Profile": "high",
                      "Sar": "1:1",
                      "StartTime": "0.000000",
                      "Timebase": "1/24000",
                      "Width": "1280"
                    }
                  ]
                }
              },
              "Width": "1280"
            },
            "Rotate": "180",
            "SubtitleConfig": {
              "ExtSubtitleList": {
                "ExtSubtitle": [
                  {
                    "CharEnc": "UTF-8",
                    "FontName": "\"WenQuanYi Zen Hei\", \"Yuanti SC Regular\", \"SimSun\"",
                    "Input": {
                      "Bucket": "example-bucket-****",
                      "Location": "oss-cn-hangzhou",
                      "Object": "example-output.flv"
                    }
                  }
                ]
              },
              "SubtitleList": {
                "Subtitle": [
                  {
                    "Map": "0:a:0"
                  }
                ]
              }
            },
            "SuperReso": {
              "IsHalfSample": "true"
            },
            "TailSlateList": {
              "TailSlate": [
                {
                  "BgColor": "White",
                  "BlendDuration": "2",
                  "Height": "1080",
                  "IsMergeAudio": false,
                  "Start": "1",
                  "TailUrl": "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/opening_01.flv",
                  "Width": "1920"
                }
              ]
            },
            "TemplateId": "S00000000-000010",
            "TransConfig": {
              "AdjDarMethod": "crop",
              "IsCheckAudioBitrate": "false",
              "IsCheckAudioBitrateFail": "true",
              "IsCheckReso": "false",
              "IsCheckResoFail": "false",
              "IsCheckVideoBitrate": "false",
              "IsCheckVideoBitrateFail": "true",
              "TransMode": "onepass"
            },
            "UserData": "example data",
            "Video": {
              "Bitrate": "10",
              "BitrateBnd": {
                "Max": "20",
                "Min": "10"
              },
              "Bufsize": "1000",
              "Codec": "H.264",
              "Crf": "22",
              "Crop": "1280:800:0:140",
              "Degrain": "5",
              "Fps": "60",
              "Gop": "1",
              "Height": "1280",
              "MaxFps": "15",
              "Maxrate": "10",
              "Pad": "1280:800:0:140",
              "PixFmt": "yuvj420p",
              "Preset": "veryfast",
              "Profile": "baseline",
              "Qscale": "15",
              "ResoPriority": "1",
              "ScanMode": "interlaced",
              "Width": "1080"
            },
            "VideoStreamMap": "0:a:0",
            "WaterMarkConfigUrl": "http://example.com/configure",
            "WaterMarkList": {
              "WaterMark": [
                {
                  "Dx": "1",
                  "Dy": "1",
                  "Height": "1280",
                  "InputFile": {
                    "Bucket": "example-bucket",
                    "Location": "oss-cn-hangzhou",
                    "Object": "example-logo-****.png"
                  },
                  "ReferPos": "TopRight",
                  "Type": "Image",
                  "WaterMarkTemplateId": "88c6ca184c0e47098a5b665e2a12****",
                  "Width": "1080"
                }
              ]
            }
          },
          "Percent": 100,
          "PipelineId": "88c6ca184c0e47098a5b665e2a126797",
          "State": "Submitted"
        },
        "Message": "The specified parameter \"%s\" cannot be null.",
        "Success": true
      }
    ]
  },
  "RequestId": "25818875-5F78-4A45S71F6-D73936451234"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.