All Products
Search
Document Center

ApsaraVideo Media Processing:SubmitJobs

Last Updated:Jun 11, 2026

Mengirimkan pekerjaan transkoding. Anda dapat menggunakan operasi ini jika tugas atau alur kerja transkoding yang dibuat di konsol tidak memenuhi kebutuhan Anda. Anda dapat mengonfigurasi parameter transkoding yang diperlukan berdasarkan logika bisnis Anda.

Deskripsi operasi

  • Transcoding jobs are asynchronous jobs. They are not guaranteed to be executed immediately. After you submit a transcoding job, it is added to an MPS queue and waits for scheduling. Therefore, the API response does not indicate that the transcoding is complete. To check the result, you can call the QueryTranscodeJobList operation to poll for the status, or configure MNS message notifications for the queue. For more information, see Receive message notifications.

  • The maximum size of a single input file is 100 GB. Larger files may cause the job to fail.

  • To transcode an input file using a preset intelligent template, first call the SubmitAnalysisJob operation (SubmitAnalysisJob) to submit a template analysis job. After the analysis job is successful, call the QueryAnalysisJobList operation (QueryAnalysisJobList) to retrieve the list of available preset templates for the input file. When you submit the transcoding job, set the TemplateId parameter to one of the available preset template IDs. If the specified template is not in the list of available preset templates, the transcoding job fails.

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

  • To use multiple Alibaba Cloud accounts with MPS, you can create RAM users for your Alibaba Cloud account. For more information, see Create a RAM user and grant permissions. If you submit and query a transcoding job using different Alibaba Cloud accounts, no data is returned in the query results.

  • For answers to frequently asked questions about transcoding, see the ApsaraVideo Media Processing FAQ.

QPS limit

The QPS limit for this operation is 100 requests per second per user. Exceeding this limit triggers rate limiting, which may affect your business. Call this operation accordingly. For more information, see QPS limits.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

mts:SubmitJobs

create

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

Input

string

Yes

Input pekerjaan. Untuk detail, lihat Detail input.

Catatan
  • Di API ApsaraVideo Media Processing, nilai Object harus dikodekan URL menggunakan pengkodean UTF-8.

  • Wilayah OSS harus sama dengan wilayah tempat MPS diterapkan.

{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"example.flv","Referer": "用户自行在OSS控制台设置的OSS防盗链参数"}

Outputs

string

Yes

Konfigurasi output pekerjaan. Untuk detail, lihat Detail output.

  • Outputs adalah array JSON dari objek Output. Ukuran maksimum adalah 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

Bucket OSS tempat file output disimpan.

  • Mengikuti definisi bucket OSS. Untuk informasi lebih lanjut, lihat Istilah.

exampleBucket

OutputLocation

string

No

Wilayah OSS tempat bucket output berada.

  • Bucket OSS harus berada di wilayah yang sama dengan layanan ApsaraVideo Media Processing.

  • Mengikuti definisi bucket OSS. Untuk informasi lebih lanjut, lihat Istilah.

oss-cn-hangzhou

PipelineId

string

Yes

ID pipeline. Untuk informasi lebih lanjut, lihat Istilah.

  • Anda dapat menemukannya di Konsol MPS > Pengaturan > Pipeline dan callback.

  • Untuk menerima notifikasi asinkron, ikatkan topik Paket MNS ke pipeline. Untuk detail, lihat Menerima notifikasi Paket.

dd3dae411e704030b921e52698e5****

Elemen respons

Element

Type

Description

Example

object

Response parameters.

JobResultList

object

JobResult

array<object>

List of submitted transcoding jobs.

array<object>

Response parameters.

Code

string

The error code returned if the job failed to be created. This parameter is not returned if the job was created.

InvalidParameter.NullValue

Job

object

The details of the job. If the job fails to be submitted, no job ID is generated.

Code

string

The error code returned if the job failed. This parameter is not returned if the job was successful.

InternalError

CreationTime

string

The time when the job was created.

2014-01-10T12:00:00Z

FinishTime

string

The time when the job was complete.

2014-01-10T12:20:00Z

Input

object

The information about the job input.

Bucket

string

The name of the OSS bucket in which the job input is stored.

example-bucket-****

Location

string

The ID of the OSS region in which the job input is stored.

oss-cn-hangzhou

Object

string

The name of the OSS object that is used as the job input.

example.flv

JobId

string

The job ID.

31fa3c9ca8134f9cec2b4b0b0f78****

MNSMessageResult

object

The message sent by MNS to notify users of the job result.

ErrorCode

string

The error code returned if the job failed. This parameter is not returned if the job was successful.

InvalidParameter.ResourceNotFound

ErrorMessage

string

The error message returned if the job failed. This parameter is not returned if the job was successful.

The resource operated "%s" cannot be found.

MessageId

string

The ID of the error message returned if the job failed. This parameter is not returned if the job was successful.

123

Message

string

The error message returned if the job failed. This parameter is not returned if the job was successful.

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

Output

object

The output of the job.

AmixList

object

Amix

array<object>

The audio tracks that are mixed.

object

AmixURL

string

The URL of the audio track that is mixed as the background music.

  • The URL can be an OSS URL or the string input.

  • A value of input indicates that two audio tracks are mixed in a video.

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

Duration

string

The duration of the mixed audio track. The value is in the number or time format.

20

Map

string

The audio track that is mixed. Format: 0:a:{audio_index}. Example: 0:a:0.

0:a:0

MixDurMode

string

The mode to specify the mixing duration. Valid values: first and long.

  • first: The length of the output media equals the length of the input media.

  • long: The length of the output media equals the length of the output media or the length of the input media, whichever is longer.

  • Default value: long.

long

Start

string

The start time. The value is in the number or time format. Examples: 1:25:36.240 and 32000.23.

0

Audio

object

The audio configurations.

Catatan

If this parameter is specified in the request, the corresponding configurations in the specified transcoding template are overwritten.

Bitrate

string

The audio bitrate of the output file.

  • Unit: Kbit/s.

  • Default value: 128.

128

Channels

string

The number of sound channels.

  • If the value of Codec is mp3, the value of this parameter can only be 1 or 2.

  • If the value of Codec is aac, the value of this parameter can only be 1, 2, 4, 5, 6, or 8.

  • Default value: 2.

6

Codec

string

The audio codec.

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

  • Default value: aac.

aac

Profile

string

The codec profile of the audio.

Catatan

Valid values if the value of Codec is aac: aac_low, aac_he, aac_he_v2, aac_ld, and aac_eld.

aac_low

Qscale

string

The level of quality control on the audio.

15

Samplerate

string

The sampling rate.

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

  • Unit: Hz.

  • Default value: 44100.

Catatan

If the video container format is FLV and the audio codec is MP3, the value of this parameter cannot be 32000, 48000, or 96000. If the audio codec is MP3, the value of this parameter cannot be 96000.

32000

Volume

object

The volume configurations.

Level

string

The volume adjustment range.

  • Unit: decibel.

  • Default value: -20.

-20

Method

string

The method that is used to adjust the volume. Valid values:

  • auto

  • dynamic

  • linear

auto

AudioStreamMap

string

The sequence number of the audio stream.

  • Format: 0:a:{Sequence number}. Example: 0:a:0.

  • The sequence number is the index of the audio stream in the list and starts from 0.

  • If no sequence number is specified, the default audio stream is used.

0:a:0

Clip

object

The information about the clip.

TimeSpan

object

The time span of the clip.

Duration

string

The duration of the clip.

  • 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 configurations.

Format

string

The container format.

  • Default value: mp4.

  • Video formats include FLV, MP4, HLS (M3U8 + TS), and MPEG-DASH (MPD + fMP4).

  • Audio formats include MP3, MP4, Ogg, FLAC, and M4A.

  • Image formats include GIF and WebP.

  • If the container format is GIF, the video codec must be GIF.

  • If the container format is WebP, the video codec must be WebP.

  • If the container format is FLV, the video codec cannot be H.265.

flv

DeWatermark

string

The configurations of watermark blurring. The value is a JSON object. For more information, see the DeWatermark section of the Parameter details topic.

{"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 watermarks.

Alpha

string

The transparency of the text or image.

  • Value values: (0,1].

  • Default value: 1.0.

1.0

InputFile

object

The details of the input file.

Bucket

string

The name of the OSS bucket in which the input file is stored.

example-bucket-****

Location

string

The ID of the OSS region in which the input file is stored.

oss-cn-hangzhou

Object

string

The name of the OSS object that is used as the input file.

example-intput.flv

Type

string

The type of the watermark. If this parameter is specified in the request, the corresponding parameter in the watermark template is overwritten. Valid values:

  • Image (default)

  • Text

Image

Encryption

object

The encryption configurations. Only outputs in the M3U8 format are supported.

Id

string

The encryption ID.

31fa3c9ca8134f9cec2b4b0b0f78****

Key

string

The key that is used to encrypt the video.

encryptionkey128

KeyType

string

The key encryption method. Keys cannot be transmitted to MPS in plaintext. Keys must be encrypted by using Base64 or Key Management Service (KMS). For example, if the key is encryptionkey128, you can encrypt the key by using the following method: Base64("encryptionkey128") or KMS(Base64("encryptionkey128").

Base64

KeyUri

string

The URL that is used to request the key. The URL is Base64-encoded.

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

SkipCnt

string

The number of unencrypted frames at the beginning of the video. Leaving these frames unencrypted enables video playback to quickly start.

3

Type

string

The encryption type. Only hls-aes-128 may be returned.

hls-aes-128

M3U8NonStandardSupport

object

The non-standard support configuration for M3U8. The value is a JSON object. For more information, see the M3U8NonStandardSupport section of the Parameter details topic.

TS

object

The non-standard support configurations for TS files. The value is a JSON object. For more information, see the TS section of the Parameter details topic.

Md5Support

boolean

Indicates whether the output of the MD5 value of the TS file is supported in the M3U8 video. Valid values:

  • true

  • false

true

SizeSupport

boolean

Indicates whether the size of the TS file is generated in the output M3U8 video. Valid values:

  • true

  • false

true

MergeConfigUrl

string

The URL of the merging configuration file. Only one of MergeList and MergeConfigUrl takes effect.

  • The configuration file specified by MergeConfigUrl can contain up to 50 clips.

  • MergeConfigUrl indicates the URL of the configuration file for merging clips.

  • Make sure that the configuration file is stored as an object in OSS and that MPS can access the OSS object. For information about the file content, see the details about merging parameters.

  • Example of the content of the merging configuration file: {"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 configurations for merging clips.

object

Duration

string

The duration of the clip.

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

  • Examples: 01:59:59.999 and 32000.23.

00000.20

MergeURL

string

The OSS URL of the clip.

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

  • The OSS URL of the object must be URL-encoded by using the UTF-8 standard.

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

RoleArn

string

The Alibaba Cloud Resource Name (ARN) of the Resource Access Management (RAM) role used for delegated authorization.

acs:ram:::role/

Start

string

The start point in time of the clip.

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

  • Examples: 01:59:59.999 and 32000.23.

00000.50

MuxConfig

object

The transmuxing configurations. If this parameter is specified in the request, the corresponding configurations in the specified transcoding template are overwritten.

Gif

object

The transmuxing configurations for GIF.

DitherMode

string

The color dithering algorithm of the palette. Valid values: sierra and bayer.

bayer

FinalDelay

string

The duration for which the final frame is paused. Unit: centisecond.

0

IsCustomPalette

string

Indicates whether a custom palette is used. Valid values:

  • true

  • false

false

Loop

string

The loop count.

0

Segment

object

The segment configuration. The value is a JSON object.

Duration

string

The length of the segment. The value is an integer. Unit: seconds.

  • Valid values: [1,10].

  • Default value: 10.

20

Webp

object

The transmuxing configurations for WebP.

Loop

string

The loop count.

0

OpeningList

object

Opening

array<object>

The opening parts. The value is a JSON object.

object

Height

string

The height of the opening part.

  • Valid values: values in the range of (0,4096), -1, and full.

  • Default value: -1.

  • A value of -1 indicates that the height of the source of the opening part is retained.

  • A value of full indicates that the height of the main part is used for the opening part.

1080

Start

string

The amount of time after which the opening part is played. The value starts from 0.

  • Unit: seconds.

  • Default value: 0.

1

Width

string

The width of the opening part.

  • Valid values: values in the range of (0,4096), -1, and full.

  • Default value: -1.

  • A value of -1 indicates that the width of the source of the opening part is retained.

  • A value of full indicates that the width of the main part is used for the opening part.

1920

openUrl

string

The OSS URL of the opening part.

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

OutSubtitleList

object

OutSubtitle

array<object>

The output subtitles.

array<object>

Map

string

The video track. Format: 0:{Stream}:{Stream sequence number}, which is 0:v:{video_index}. The value of Stream is v, which indicates a video stream. The sequence number is the index of the video stream in the list and starts from 0.

0:v:0

Message

string

The error message returned if the job failed to be created. This parameter is not returned if the job was created.

The specified parameter “%s” cannot be null.

OutSubtitleFile

object

The details of the output file.

Bucket

string

The name of the OSS bucket in which the input file is stored.

example-bucket-****

Location

string

The ID of the OSS region in which the output file is stored.

oss-cn-hangzhou

Object

string

The name of the OSS object that is used as the output file.

example-output.flv

RoleArn

string

The ARN of the RAM role used for delegated authorization.

acs:ram:::role/

Success

boolean

Indicates whether the job was created. Valid values:

  • true

  • false

true

OutputFile

object

The details of the output file.

Bucket

string

The name of the OSS bucket in which the input file is stored.

example-bucket-****

Location

string

The ID of the OSS region in which the output file is stored.

oss-cn-hangzhou

Object

string

The name of the OSS object that is used as the output file.

example-output.flv

RoleArn

string

The ARN of the RAM role used for delegated authorization.

acs:ram:::role/

Priority

string

The priority of the job in the MPS queue to which the job is added.

  • A value of 10 indicates the highest priority.

  • Default value: 6.

5

Properties

object

The media properties.

Bitrate

string

The bitrate of the video.

1000

Duration

string

The duration of the video.

55

FileFormat

string

The format of the video.

QuickTime / MOV

FileSize

string

The size of the file.

3509895

Format

object

The format information.

Bitrate

string

The total bitrate.

1000

Duration

string

The total duration.

55

FormatLongName

string

The full name of the container format.

QuickTime / MOV

FormatName

string

The short name of the container 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 size of the file.

3509895

StartTime

string

The start time.

0.000000

Fps

string

The frame rate of the video. The value is a number.

25

Height

string

The height of the video.

720

Streams

object

The stream information.

AudioStreamList

object

AudioStream

array<object>

The audio streams.

object

Bitrate

string

The bitrate of the audio stream.

128.806

ChannelLayout

string

The output layout of the sound channels.

stereo

Channels

string

The number of sound channels.

2

CodecLongName

string

The full name of the codec.

AAC (Advanced Audio Coding)

CodecName

string

The short name of the codec.

aac

CodecTag

string

The tag of the codec.

0x6134706d

CodecTagString

string

The tag string of the codec.

mp4a

CodecTimeBase

string

The codec time base.

1/44100

Duration

string

The duration of the audio stream.

17.159546

Index

string

The sequence number of the audio stream. The value indicates the position of the audio stream in all audio streams.

1

Lang

string

The language of the audio stream. For more information, see FFmpeg documentation and ISO 639.

eng

NumFrames

string

The total number of frames.

25

SampleFmt

string

The sampling format.

fltp

Samplerate

string

The sampling rate of the audio stream.

44100

StartTime

string

The start time of the audio stream.

0.000000

Timebase

string

The time base of the audio stream.

1/44100

SubtitleStreamList

object

SubtitleStream

array<object>

The subtitle streams.

object

Index

string

The sequence number of the subtitle stream. The value indicates the position of the subtitle stream in all subtitle streams.

1

Lang

string

The language of the subtitle stream. For more information, see FFmpeg documentation and ISO 639.

eng

VideoStreamList

object

VideoStream

array<object>

The video streams.

array<object>

AvgFPS

string

The average frame rate of the video stream.

23.976025

Bitrate

string

The bitrate of the video stream.

1496.46

CodecLongName

string

The full name of the codec.

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

CodecName

string

The short name of the codec.

h264

CodecTag

string

The tag of the codec.

0x31637661

CodecTagString

string

The tag string of the codec.

avc1

CodecTimeBase

string

The codec time base.

1001/48000

Dar

string

The display aspect ratio (DAR) of the video stream.

16:9

Duration

string

The duration of the video stream.

17.225542

Fps

string

The frame rate of the video stream.

23.976025

HasBFrames

string

Indicates whether the video stream contains B-frames.

2

Height

string

The height of the video stream in pixels.

720

Index

string

The sequence number of the video stream. The value indicates the position of the video stream in all video streams.

0

Lang

string

The language of the video stream. For more information, see FFmpeg documentation and ISO 639.

eng

Level

string

The codec level.

51

NetworkCost

object

The network bandwidth that was consumed.

AvgBitrate

string

The average bitrate of the video stream.

100

CostBandwidth

string

The maximum bandwidth that was consumed.

10

PreloadTime

string

The amount of time consumed to preload the video stream.

8

NumFrames

string

The total number of frames.

25

PixFmt

string

The pixel format of the video stream.

yuv420p

Profile

string

The codec profile.

high

Sar

string

The sample aspect ratio (SAR) of the video stream.

1:1

StartTime

string

The start time of the video stream.

0.000000

Timebase

string

The time base of the video stream.

1/24000

Width

string

The width of the video stream in pixels.

1280

Width

string

The width of the video.

1280

Rotate

string

The rotation angle of the video, in the clockwise direction.

180

SubtitleConfig

object

The subtitle configurations.

ExtSubtitleList

object

ExtSubtitle

array<object>

The external subtitles. The value is a JSON array that contains up to four objects.

array<object>

CharEnc

string

The character set used by the external subtitle.

  • Valid values: UTF-8, GBK, BIG5, and auto.

  • Default value: auto.

Catatan

If this parameter is set to auto, the detected character set may not be the actual character set. We recommend that you set this parameter to another value.

UTF-8

FontName

string

The font of the hardcoded subtitles converted from external subtitles. Default value: SimSun. For more information, see Fonts.

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

Input

object

The OSS object that is used as the external subtitle. The value is a JSON object. Files in the SRT or ASS format are supported.

Bucket

string

The name of the OSS bucket in which the input file is stored.

example-bucket-****

Location

string

The ID of the OSS region in which the input file is stored.

oss-cn-hangzhou

Object

string

The name of the OSS object that is used as the input file.

example-output.flv

SubtitleList

object

Subtitle

array<object>

The subtitles.

object

Map

string

The audio track. Format: 0:{Stream}:{Stream sequence number}, which is 0:a:{audio_index}. The value of Stream is a, which indicates an audio stream. The sequence number is the index of the audio stream in the list and starts from 0.

0:a:0

SuperReso

object

The configurations for using the resolution of the source video.

IsHalfSample

string

Indicates whether parameters related to the sampling rate are obtained. Valid values:

  • true

  • false

true

TailSlateList

object

TailSlate

array<object>

The ending parts. The value is a JSON object.

object

BgColor

string

The color of the bars that are added to the ending part if the size of the ending part is smaller than that of the main part. Default value: White. For more information, see Background colors.

White

BlendDuration

string

The duration of the transition between the main part and the ending part. A fade transition is used: The last frame of the main part fades out, and the first frame of the ending part fades in. Unit: seconds. Default value: 0.

2

Height

string

The height of the ending part.

  • Valid values: values in the range of (0,4096), -1, and full.

  • A value of -1 indicates that the height of the source of the ending part is retained. A value of full indicates that the height of the main part is used for the ending part.

  • Default value: -1.

1080

IsMergeAudio

boolean

Indicates whether the audio content of the ending part is merged. Valid values:

  • true

  • false

false

Start

string

The start time.

1

TailUrl

string

The OSS URL of the ending part.

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

Width

string

The width of the ending part.

  • Valid values: values in the range of (0,4096), -1, and full.

  • A value of -1 indicates that the width of the source of the ending part is retained. A value of full indicates that the width of the main part is used for the ending part.

  • Default value: -1.

1920

TemplateId

string

The ID of the transcoding template.

S00000000-000010

TransConfig

object

The general transcoding configurations.

Catatan

If this parameter is specified in the request, the corresponding parameter in the specified transcoding template are overwritten.

AdjDarMethod

string

The method of resolution adjustment. Default value: none. Valid values:

  • rescale: The video image is resized.

  • crop: The video image is cropped.

  • pad: The video image is scaled out to fill the view.

  • none: The resolution is not adjusted.

crop

IsCheckAudioBitrate

string

Indicates whether the audio bitrate is checked. If the bitrate of the output audio is higher than that of the input audio, the input bitrate is retained and the specified audio bitrate does not take effect. This parameter has a lower priority than IsCheckAudioBitrateFail. Valid values:

  • true

  • false

  • Default value:

    • If this parameter is empty and the codec of the output audio is different from the codec of the input audio, the default value is false.

    • If this parameter is empty and the codec of the output audio is the same as the codec of the input audio, the default value is true.

false

IsCheckAudioBitrateFail

string

Indicates whether the audio bitrate is checked. This parameter has a higher priority than IsCheckAudioBitrate. If the bitrate of the output audio is higher than that of the input audio, a transcoding failure is returned without transcoding the audio. Valid values:

  • false

  • true

true

IsCheckReso

string

Indicates whether the resolution is checked. If the output resolution is higher than the input resolution based on the width or height, the input resolution is retained. Valid values:

  • true

  • false

  • Default value: false.

false

IsCheckResoFail

string

Indicates whether the resolution is checked. This parameter has a higher priority than IsCheckReso. If the output resolution is higher than the input resolution based on the width or height, a transcoding failure is returned without transcoding the video. Valid values:

  • true

  • false

  • Default value: false.

false

IsCheckVideoBitrate

string

Indicates whether the video bitrate is checked. If the bitrate of the output video is higher than that of the input video, the input bitrate is retained. Valid values:

  • true

  • false

  • Default value: false.

false

IsCheckVideoBitrateFail

string

Indicates whether the video bitrate is checked. If the bitrate of the output video is higher than that of the input video, a transcoding failure is returned without transcoding the video. This parameter has a higher priority thanIsCheckVideoBitrate. Valid values:

  • true

  • false

  • Default value: false.

true

TransMode

string

The transcoding mode. Valid values:

  • onepass: transcoding based on one-pass algorithms, which has higher accuracy.

  • twopass: transcoding based on two-pass algorithms, which has lower accuracy.

  • CBR: transcoding based on a fixed bitrate.

onepass

UserData

string

The custom data.

example data

Video

object

The video configurations.

Catatan

If this parameter is specified, AliyunVideoCodec in the template specified by TemplateId is overwritten.

Bitrate

string

The bitrate of the output video. Unit: Kbit/s.

10

BitrateBnd

object

The average bitrate range of the video.

Max

string

The upper limit of the total bitrate. Unit: Kbit/s.

20

Min

string

The lower limit of the total bitrate. Unit: Kbit/s.

10

Bufsize

string

The size of the buffer.

  • Unit: KB.

  • Default value: 6000.

1000

Codec

string

The video codec.

  • Valid values: H.264, H.265, GIF, and WEBP.

  • Default value: H.264.

H.264

Crf

string

The constant rate factor.

  • If Crf is returned, the value of Bitrate is invalid.

  • Default value if the value of Codec is H.264: 23. Default value if the value of Codec is H.265: 26.

22

Crop

string

The method of video cropping. Valid values:

  • border: Black borders are automatically detected and removed.

  • A value in the format of width:height:left:top: The video is cropped based on the custom settings.

1280:800:0:140

Degrain

string

The strength of the independent noise reduction algorithm.

5

Fps

string

The frame rate.

  • Unit: frames per second.

  • Valid values: 0 to 60. The value is 60 if the frame rate of the input file exceeds 60.

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

60

Gop

string

The maximum interval between keyframes or the maximum number of frames in a frame group. Unit: seconds.

  • Default value: 10.

  • If the maximum number of frames is returned, the value does not have a unit.

1

Height

string

The height of the video.

  • Unit: pixel.

  • Default value: the height of the input video.

1280

MaxFps

string

The maximum frame rate.

15

Maxrate

string

The maximum bitrate of the video. Unit: Kbit/s.

10

Pad

string

The black borders that are added to the video.

  • The value is in the width:height:left:top format.

  • Unit: pixel.

1280:800:0:140

PixFmt

string

The pixel format of the video.

  • The default pixel format can be yuv420p or the pixel format of the input file.

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

    **

    Note If a non-standard pixel format such as yuvj420p(pc, bt470bg/bt470bg/smpte170m) is used, compatibility with the pixel format must be configured. Otherwise, the transcoding job fails.

yuvj420p

Preset

string

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

  • veryfast

  • fast

  • medium

  • slow

  • slower

veryfast

Profile

string

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

Catatan

If multiple definitions are involved, we recommend that you use baseline for the lowest definition to ensure normal playback on low-definition devices, and use main or high for other definitions.

  • baseline: applicable to mobile devices.

  • main: applicable to standard-definition devices.

  • high: applicable to high-definition devices.

baseline

Qscale

string

The level of quality control on the video.

15

ResoPriority

string

The priority of the resource.

1

ScanMode

string

The scan mode. Valid values:

  • If this parameter is empty, the scan mode of the input file is used.

  • auto: automatic deinterlacing.

  • progressive: progressive scan.

  • interlaced: interlaced scan.

  • By default, this parameter is empty.

Best practice: Interlaced scan consumes less bandwidth than progressive scan, but the image quality is poor. Therefore, mainstream video production uses progressive scan.

  • If progressive scan or interlaced scan is used when the scan mode of the input file is neither of them, the transcoding job fails.

  • We recommend that you use the scan mode of the input file or automatic deinterlacing to improve compatibility.

interlaced

Width

string

The width of the video.

  • Unit: pixel.

  • Default value: the width of the input video.

1080

VideoStreamMap

string

The sequence number of the video stream.

  • Format: 0:a:{Sequence number}. Example: 0:a:0.

  • The sequence number is the index of the video stream in the list and starts from 0.

  • If no sequence number is specified, the default video stream is used.

0:a:0

WaterMarkConfigUrl

string

The URL of the watermark configuration file.

http://example.com/configure

WaterMarkList

object

WaterMark

array<object>

The watermarks.

Catatan

If watermarks are truncated or fail to be generated, check whether the text watermarks that you add contain special characters. If the text watermarks contain special characters, you must escape the special characters before you add the watermarks. Alternatively, you can submit a ticket to contact Alibaba Cloud customer service for compatibility processing.

array<object>

Dx

string

The horizontal offset of the watermark image relative to the output video. If this parameter is specified in the request, the corresponding parameter in the watermark template is overwritten. Default value: 0. The value can be an integer or a decimal number.

  • An integer indicates the pixel value of the horizontal offset.

    • Valid values: [8,4096].

    • Unit: pixel.

  • A decimal number indicates the ratio of the horizontal offset to the width in the output video resolution.

    • Valid values: (0,1).

    • The decimal number can be accurate to four decimal places, such as 0.9999. Excess digits are automatically deleted.

1

Dy

string

The vertical offset of the watermark image relative to the output video. If this parameter is specified in the request, the corresponding parameter in the watermark template is overwritten. The value can be an integer or a decimal number.

  • An integer indicates the pixel value of the vertical offset.

    • Valid values: [8,4096].

    • Unit: pixel.

  • A decimal number indicates the ratio of the vertical offset to the height in the output video resolution.

    • Valid values: (0,1).

    • The decimal number can be accurate to four decimal places, such as 0.9999. Excess digits are automatically deleted.

1

Height

string

The height of the watermark. If this parameter is specified in the request, the corresponding parameter in the watermark template is overwritten. The value can be an integer or a decimal number.

  • An integer indicates the pixel value of the watermark height.

    • Valid values: [8,4096].

    • Unit: pixel.

  • A decimal number indicates the ratio of the watermark height to the height in the output video resolution.

    • Valid values: (0,1).

    • The decimal number can be accurate to four decimal places, such as 0.9999. Excess digits are automatically deleted.

1280

InputFile

object

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

Bucket

string

The name of the OSS bucket in which the input file is stored.

example-bucket

Location

string

The ID of the OSS region in which the input file is stored.

oss-cn-hangzhou

Object

string

The name of the OSS object that is used as the input file.

example-logo-****.png

ReferPos

string

The position of the watermark. If this parameter is specified in the request, the corresponding parameter in the watermark template is overwritten. Valid values:

  • TopRight

  • TopLeft

  • BottomRight

  • BottomLeft

TopRight

Type

string

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

  • Image

  • Text

Image

WaterMarkTemplateId

string

The ID of the watermark template.

88c6ca184c0e47098a5b665e2a12****

Width

string

The width of the watermark image. If this parameter is specified in the request, the corresponding parameter in the watermark template is overwritten. The value can be an integer or a decimal number.

  • An integer indicates the pixel value of the watermark width.

    • Valid values: [8,4096].

    • Unit: pixel.

  • A decimal number indicates the ratio of the watermark width to the width in the output video resolution.

    • Valid values: (0,1).

    • The decimal number can be accurate to four decimal places, such as 0.9999. Excess digits are automatically deleted.

1080

Percent

integer

The transcoding progress.

100

PipelineId

string

The ID of the MPS queue.

88c6ca184c0e47098a5b665e2a126797

State

string

The state of the job. Valid values:

  • Submitted

  • TranscodeFail

Submitted

Message

string

The error message returned if the job failed to be created. This parameter is not returned if the job was created.

The specified parameter "%s" cannot be null.

Success

boolean

Indicates whether the job was successful. Valid values:

  • true

  • false

true

RequestId

string

Request ID.

25818875-5F78-4A45S71F6-D73936451234

Contoh

Respons sukses

JSONformat

{
  "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"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.