Tous les produits
Search
Centre de documentation

:SubmitJobs

Dernière mise à jour :Aug 07, 2026

Cette opération soumet une tâche de transcodage. Vous pouvez utiliser cette opération si les tâches de transcodage ou les flux de travail créés dans la console ne répondent pas à vos besoins. Vous pouvez configurer les paramètres de transcodage requis en fonction de votre logique métier.

Description de l'opération

  • Les travaux de transcodage sont des travaux asynchrones. Leur exécution immédiate n'est pas garantie. Une fois qu'un travail de transcodage est soumis, il est ajouté à une file d'attente MPS et attend d'être planifié. Par conséquent, la réponse de l'API n'indique pas que le transcodage est terminé. Pour vérifier le résultat, vous pouvez appeler l'opération QueryTranscodeJobList pour interroger l'état, ou configurer des notifications de messages MNS pour la file d'attente. Pour plus d'informations, consultez Recevoir des notifications de messages.

Testez maintenant

Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale. Testez cette API dans OpenAPI Explorer, sans signature manuelle. Les appels réussis génèrent automatiquement du code SDK correspondant à vos paramètres. Téléchargez-le avec une sécurité intégrée des identifiants pour une utilisation locale.

Test

Autorisation RAM

Le tableau ci-dessous décrit les autorisations nécessaires pour appeler cette API. Vous pouvez les définir dans une politique Resource Access Management (RAM). Les colonnes du tableau sont détaillées ci-dessous :

  • Action : les actions peuvent être utilisées dans l'élément Action des instructions de politique de permissions RAM pour accorder les autorisations nécessaires à l'exécution de l'opération.

  • API : l'API que vous pouvez appeler pour exécuter l'action.

  • Niveau d'accès : le niveau d'accès prédéfini accordé pour chaque API. Valeurs valides : create, list, get, update et delete.

  • Type de ressource : le type de ressource qui prend en charge l'autorisation pour exécuter l'action. Il indique si l'action prend en charge les permissions au niveau de la ressource. La ressource spécifiée doit être compatible avec l'action. Sinon, la politique sera inefficace.

    • Pour les API avec permissions au niveau de la ressource, les types de ressource requis sont marqués d'un astérisque (*). Spécifiez l'Alibaba Cloud Resource Name (ARN) correspondant dans l'élément Resource de la politique.

    • Pour les API sans permissions au niveau de la ressource, la valeur All Resources est affichée. Utilisez un astérisque (*) dans l'élément Resource de la politique.

  • Clé de condition : les clés de condition définies par le service. La clé permet un contrôle granulaire, applicable aux actions seules ou aux actions associées à des ressources spécifiques. En plus des clés de condition propres au service, Alibaba Cloud fournit un ensemble de clés de condition communes applicables à tous les services pris en charge par RAM.

  • Action dépendante : les actions dépendantes requises pour exécuter l'action. Pour mener à bien l'opération, l'utilisateur RAM ou le rôle RAM doit disposer des permissions pour toutes les actions dépendantes.

mts:SubmitJobs

create

*All Resource

*

Aucune Aucune

Paramètres de requête

Paramètre

Type

Requis

Description

Exemple

Input

string

Oui

Entrée de la tâche. Pour plus de détails, consultez Détails de l'entrée.

Remarque
  • Dans les API ApsaraVideo Media Processing, la valeur Object doit être encodée en URL au format UTF-8.

  • La région OSS doit correspondre à la région où MPS est déployé.

{"Bucket":"exampleBucket","Location":"oss-cn-hangzhou","Object":"Example.flv","Referer": "Paramètres de protection contre le hotlinking OSS définis par l'utilisateur dans la console OSS"}

Outputs

string

Oui

Configurations de sortie de la tâche. Pour plus de détails, consultez Détails des sorties.

  • Outputs est un tableau JSON d'objets Output. La taille maximale est de 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

Oui

Le bucket OSS où les fichiers de sortie sont stockés.

  • Suit la définition du bucket OSS. Pour plus d'informations, consultez Termes.

exampleBucket

OutputLocation

string

Non

La région OSS (région OSS) où se trouve le bucket de sortie.

  • Le bucket OSS doit se trouver dans la même région que le service ApsaraVideo Media Processing.

  • Suit la définition du bucket OSS. Pour plus d'informations, consultez Termes.

oss-cn-hangzhou

PipelineId

string

Oui

L'identifiant du pipeline. Pour plus d'informations, consultez Termes.

  • Vous pouvez le trouver dans la console MPS > Paramètres > Pipelines et rappels.

  • Pour recevoir des notifications asynchrones, liez une rubrique de messages MNS au pipeline. Pour plus de détails, consultez Recevoir des notifications de messages.

dd3dae411e704030b921e52698e5****

Éléments de réponse

Élément

Type

Description

Exemple

object

Paramètres de réponse.

JobResultList

object

JobResult

array<object>

Liste des travaux de transcodage soumis.

array<object>

Paramètres de réponse.

Code

string

Error code if the job creation fails. This parameter is not returned if the job is created successfully.

InvalidParameter.NullValue

Job

object

Detailed job information. No job ID is generated if the job submission fails.

Code

string

Error code if transcoding fails. This parameter is not returned if transcoding succeeds.

InternalError

CreationTime

string

Time when the job was added.

2014-01-10T12:00:00Z

FinishTime

string

Time when the job finished.

2014-01-10T12:20:00Z

Input

object

Job input.

Bucket

string

OSS bucket for the job input.

example-bucket-****

Location

string

OSS location for the job input.

oss-cn-hangzhou

Object

string

OSS object for the job input.

example.flv

JobId

string

Job ID.

31fa3c9ca8134f9cec2b4b0b0f78****

MNSMessageResult

object

MNS notification result for job completion.

ErrorCode

string

Error code if the notification fails. This parameter is not returned if the notification succeeds.

InvalidParameter.ResourceNotFound

ErrorMessage

string

Error message if the notification fails. This parameter is not returned if the notification succeeds.

The resource operated "%s" cannot be found.

MessageId

string

Error message ID if the notification fails. This parameter is not returned if the notification succeeds.

123

Message

string

Message if transcoding fails. This parameter is not returned if transcoding succeeds.

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

Output

object

Job output.

AmixList

object

Amix

array<object>

Audio mixing list.

object

Response parameters.

AmixURL

string

Media file to be mixed as background audio.

  • Valid values: An OSS URL or the string "input".

  • Input scenario: Mix two audio tracks from the same video.

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

Duration

string

Duration. Format: numeric or time format.

20

Map

string

Select the target audio track from AmixURL. Valid values: 0:a:{audio_index}, such as 0:a:0.

0:a:0

MixDurMode

string

Media duration selection. Valid values: first, long.

  • first: Use the input media duration as the output media duration.

  • long: Use the longer duration between the two media files as the output media duration.

  • Default value: long.

long

Start

string

Start time. Format: numeric or time format, such as "1:25:36.240" or "32000.23".

0

Audio

object

Audio configuration.

Remarque

If you specify audio configuration in the request parameters, it overrides the corresponding parameters in the specified transcoding template.

Bitrate

string

Audio bitrate of the output file.

  • Unit: Kbps.

  • Default value: 128.

128

Channels

string

Number of sound channels.

  • When Codec is set to mp3, valid values are 1 and 2.

  • When Codec is set to aac, valid values are 1, 2, 4, 5, 6, and 8.

  • Default value: 2.

6

Codec

string

Audio codec format.

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

  • Default value: aac.

aac

Profile

string

Audio codec profile.

Remarque

When Codec is aac, valid values include aac_low, aac_he, aac_he_v2, aac_ld, and aac_eld.

aac_low

Qscale

string

Audio quality control factor.

15

Samplerate

string

Sample rate.

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

  • Unit: Hz.

  • Default value: 44100.

Remarque

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

32000

Volume

object

Volume control.

Level

string

Volume adjustment level.

  • Unit: dB.

  • Default: -20 dB.

-20

Method

string

Volume adjustment method. Valid values:

  • auto: Automatic adjustment.

  • dynamic: Dynamic adjustment.

  • linear: Linear adjustment.

auto

AudioStreamMap

string

Audio stream index.

  • Format: 0:a:{index}, for example, 0:a:0.

  • The index is the position in the audio stream list, starting from 0.

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

0:a:0

Clip

object

Clipping segment.

TimeSpan

object

Clipping time span.

Duration

string

Duration.

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

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

01:00:59.999

Seek

string

Start time.

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

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

01:59:59.999

Container

object

Container.

Format

string

Container format.

  • Default value: mp4.

  • For video transcoding, valid values are flv, mp4, HLS (m3u8+ts), and MPEG-DASH (MPD+fMP4).

  • For audio transcoding, valid values are mp3, mp4, ogg, flac, and m4a.

  • For images, valid values are 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

Blur processing, as a JSON object. For more information, see Blur processing 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

Digital watermark.

Alpha

string

Transparency of text or image.

  • Valid range: (0,1].

  • Default value: 1.0.

1.0

InputFile

object

Input file.

Bucket

string

OSS bucket for the input file.

example-bucket-****

Location

string

OSS location for the input file.

oss-cn-hangzhou

Object

string

OSS object for the input file.

example-intput.flv

Type

string

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

  • Image: Default. Image watermark.

  • Text: Text watermark.

Image

Encryption

object

Data encryption. Supported only for m3u8 output.

Id

string

Encryption ID.

31fa3c9ca8134f9cec2b4b0b0f78****

Key

string

Encryption key for the video.

encryptionkey128

KeyType

string

The encryption key cannot be sent in plaintext to MPS. It must be encrypted using Base64 or KMS. For example, if the key is "encryptionkey128", use Base64("encryptionkey128") or KMS(Base64("encryptionkey128")).

Base64

KeyUri

string

URL to access the key, encoded using BASE64.

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

SkipCnt

string

Number of initial segments to skip encryption (to enable fast playback).

3

Type

string

Encryption type. Valid value: hls-aes-128.

hls-aes-128

M3U8NonStandardSupport

object

M3U8 non-standard support, as a JSON object. For more information, see M3U8 non-standard parameter support details in Parameter details.

TS

object

JSON object for TS file non-standard support. For more information, see TS parameter support details in Parameter details.

Md5Support

boolean

Whether to output the MD5 value of TS files in the M3U8 file. Valid values:

  • true: Yes.

  • false: No.

true

SizeSupport

boolean

Whether to output the size of TS files in the M3U8 file. Valid values:

  • true: Yes.

  • false: No.

true

MergeConfigUrl

string

You can specify either MergeList or MergeConfigUrl, but not both.

  • The configuration file specified by MergeConfigUrl supports up to 50 merge segments.

  • MergeConfigUrl is the URL of the merge configuration file.

  • The configuration file must be stored in OSS and have permissions granted to MPS for access. See merge parameter details for the internal file content.

  • Example mergeConfigfile content: {"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>

Video merging configuration.

object

Detailed video merging configuration.

Duration

string

Duration.

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

  • Examples: 01:59:59.999 or 32000.23.

00000.20

MergeURL

string

URL of the merge segment.

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

  • The Object value must be URL-encoded using UTF-8 encoding.

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

RoleArn

string

Role ARN used for agent authorization.

acs:ram:::role/

Start

string

Start time point.

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

  • Examples: 01:59:59.999 or 32000.23.

00000.50

MuxConfig

object

Muxing configuration. If you set this parameter in the request, it overrides the corresponding parameter in the specified transcoding template.

Gif

object

GIF muxing configuration.

DitherMode

string

Dither mode for the color palette. Valid values: sierra, bayer.

bayer

FinalDelay

string

Pause time for the final frame, in centiseconds.

0

IsCustomPalette

string

Custom color palette feature. Valid values:

  • true: Custom.

  • false: Not custom.

false

Loop

string

Number of loops.

0

Segment

object

Segmentation configuration, as a JSON object.

Duration

string

Segment duration. Integer, in seconds.

  • Valid range: [1,10].

  • Default value: 10 seconds.

20

Webp

object

WEBP muxing configuration.

Loop

string

Number of loops.

0

OpeningList

object

Opening

array<object>

Opening list, as a JSON object.

object

Response parameters.

Height

string

Height.

  • Valid values: 0~4096, -1, full.

  • Default value: -1.

  • -1 means the source height.

  • full means fill the entire screen.

1080

Start

string

Start time relative to the main video. Delay before displaying the opening video.

  • Unit: seconds.

  • Default value: 0.

1

Width

string

Width.

  • Valid values: 0~4096, -1, full.

  • Default value: -1.

  • -1 means the source width.

  • full means fill the entire screen.

1920

openUrl

string

OSS URL of the opening video.

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

OutSubtitleList

object

OutSubtitle

array<object>

Output subtitle list.

array<object>

Output subtitle details.

Map

string

Video track. Format: 0:{stream}:{stream_index}, i.e., 0:v:{video_index}. Stream values: v = video. Index is the position in the video track list, starting from 0.

0:v:0

Message

string

Error message if job creation fails. This parameter is not returned if job creation succeeds.

The specified parameter “%s” cannot be null.

OutSubtitleFile

object

Output file details.

Bucket

string

OSS bucket for the input file.

example-bucket-****

Location

string

OSS location for the output file.

oss-cn-hangzhou

Object

string

OSS object for the output file.

example-output.flv

RoleArn

string

Role ARN used for agent authorization.

acs:ram:::role/

Success

boolean

Whether the operation was successful. Valid values:

  • true: Success.

  • false: Failure.

true

OutputFile

object

Output file.

Bucket

string

OSS bucket for the input file.

example-bucket-****

Location

string

OSS location for the output file.

oss-cn-hangzhou

Object

string

OSS object for the output file.

example-output.flv

RoleArn

string

Role ARN used for agent authorization.

acs:ram:::role/

Priority

string

Priority of the job within its corresponding pipeline.

  • Highest priority: 10.

  • Default value: 6.

5

Properties

object

Media properties.

Bitrate

string

Bitrate.

1000

Duration

string

Duration.

55

FileFormat

string

File format.

QuickTime / MOV

FileSize

string

File size.

3509895

Format

object

Format information.

Bitrate

string

Total bitrate.

1000

Duration

string

Total duration.

55

FormatLongName

string

Long name of the container or encapsulation format.

QuickTime / MOV

FormatName

string

Short name of the container or encapsulation format. Valid values: mov, mp4, m4a, 3gp, 3g2, mj2.

mov

NumPrograms

string

Total number of program streams.

0

NumStreams

string

Total number of media streams.

2

Size

string

File size.

3509895

StartTime

string

Start time.

0.000000

Fps

string

Frame rate, numeric.

25

Height

string

Video height.

720

Streams

object

Stream information.

AudioStreamList

object

AudioStream

array<object>

Audio stream list.

object

Audio stream details.

Bitrate

string

Bitrate.

128.806

ChannelLayout

string

Sound channel output style.

stereo

Channels

string

Number of sound channels.

2

CodecLongName

string

Long name of the encoding format.

AAC (Advanced Audio Coding)

CodecName

string

Short name of the encoding format.

aac

CodecTag

string

Encoding format tag.

0x6134706d

CodecTagString

string

Encoding format tag text.

mp4a

CodecTimeBase

string

Codec time base.

1/44100

Duration

string

Duration.

17.159546

Index

string

Audio stream index. Identifies the position of the audio stream within the entire media stream.

1

Lang

string

Language. For more information, see FFmpeg language definition and ISO-639.

eng

NumFrames

string

Total number of frames.

25

SampleFmt

string

Sampling format.

fltp

Samplerate

string

Sample rate.

44100

StartTime

string

Start time.

0.000000

Timebase

string

Time base.

1/44100

SubtitleStreamList

object

SubtitleStream

array<object>

Subtitle stream list.

object

Subtitle stream details.

Index

string

Subtitle stream index. Identifies the position of the subtitle stream within the entire media stream.

1

Lang

string

Language. For more information, see FFmpeg language definition and ISO-639.

eng

VideoStreamList

object

VideoStream

array<object>

Video stream list.

array<object>

Video stream details.

AvgFPS

string

Average frame rate.

23.976025

Bitrate

string

Bitrate.

1496.46

CodecLongName

string

Long name of the encoding format.

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

CodecName

string

Short name of the encoding format.

h264

CodecTag

string

Encoding format tag.

0x31637661

CodecTagString

string

Encoding format tag text.

avc1

CodecTimeBase

string

Codec time base.

1001/48000

Dar

string

Display aspect ratio.

16:9

Duration

string

Duration.

17.225542

Fps

string

Frame rate.

23.976025

HasBFrames

string

Whether B-frames exist.

2

Height

string

Video resolution height.

720

Index

string

Video stream index. Identifies the position of the video stream within the entire media stream.

0

Lang

string

Language. For more information, see FFmpeg language definition and ISO-639.

eng

Level

string

Encoding profile.

51

NetworkCost

object

Network bandwidth consumption.

AvgBitrate

string

Average bitrate.

100

CostBandwidth

string

Maximum bandwidth consumed.

10

PreloadTime

string

Preload time.

8

NumFrames

string

Total number of frames.

25

PixFmt

string

Pixel format.

yuv420p

Profile

string

Codec profile.

high

Sar

string

Sample aspect ratio.

1:1

StartTime

string

Start time.

0.000000

Timebase

string

Time base.

1/24000

Width

string

Video resolution width, numeric.

1280

Width

string

Video width.

1280

Rotate

string

Clockwise rotation angle of the video.

180

SubtitleConfig

object

Subtitle configuration information.

ExtSubtitleList

object

ExtSubtitle

array<object>

List of external subtitles. A JSON array with a maximum of 4 items.

array<object>

External subtitle details.

CharEnc

string

Character encoding for external subtitles.

  • Range: UTF-8, GBK, BIG5, auto.

  • Default: auto.

Remarque

When the external subtitle character encoding is set to auto, detection errors may occur. We recommend specifying a specific character encoding.

UTF-8

FontName

string

Font name for converting external subtitles to hard subtitles. Default: SimSun. For more font information, see Font list.

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

Input

object

JSON object for the external input subtitle file. Currently supports srt and ass formats.

Bucket

string

OSS bucket for the input file.

example-bucket-****

Location

string

OSS location for the input file.

oss-cn-hangzhou

Object

string

OSS object for the input file.

example-output.flv

SubtitleList

object

Subtitle

array<object>

Subtitle list.

object

Response parameters.

Map

string

Audio track. Format: 0:{stream}:{stream_index}, i.e., 0:a:{audio_index}. The stream value is a for audio stream. The index is the position in the audio stream list, starting from 0.

0:a:0

SuperReso

object

Resolution follows source.

IsHalfSample

string

Whether to get sample rate related parameters. Valid values:

  • true: Yes.

  • false: No.

true

TailSlateList

object

TailSlate

array<object>

End slate list, as a JSON object.

object

Response parameters.

BgColor

string

If the width and height of the end slate video are smaller than the main video, set the background color for the blank areas. Default is White. For more values, see bgcolor.

White

BlendDuration

string

Transition duration between the main video and the end slate. The effect is a fade-in/fade-out: the last frame of the main video is displayed while the end slate video plays. The last frame of the main video gradually fades out, and the end slate video gradually fades in. Unit: seconds. Default: 0.

2

Height

string

Height.

  • Valid values: 0~4096, -1, full.

  • -1 means the source height, full means fill the entire screen.

  • Default: **-1**.

1080

IsMergeAudio

boolean

Whether to merge the audio content of the end slate video. Valid values:

  • true: Merge.

  • false: Do not merge.

false

Start

string

Start time.

1

TailUrl

string

OSS URL of the end slate video.

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

Width

string

Width.

  • Valid values: 0~4096, -1, full.

  • -1 means the source width, full means fill the entire screen.

  • Default: **-1**.

1920

TemplateId

string

Transcoding template ID.

S00000000-000010

TransConfig

object

General transcoding configuration.

Remarque

If you set this value in the request, it overrides the corresponding parameter in the specified transcoding template.

AdjDarMethod

string

Resolution rewriting method. Default: none. Valid values:

  • rescale: Rescale.

  • crop: Crop.

  • pad: Pad.

  • none: Do not rewrite.

crop

IsCheckAudioBitrate

string

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, meaning the set audio bitrate parameter will not take effect. This value has a lower priority than IsCheckAudioBitrateFail.

  • true means check.

  • false means do not check.

  • Default value:

    • If the parameter is empty and the codec is different from the source: false.

    • If the parameter is empty and the codec is the same as the source: true.

false

IsCheckAudioBitrateFail

string

Whether to check the audio bitrate. This value has a higher priority than IsCheckAudioBitrate. If the output audio bitrate is greater than the source audio bitrate, transcoding is not performed, and the job fails directly.

  • false: Check.

  • true: Do not check.

true

IsCheckReso

string

Whether to check the resolution. If the output resolution is greater than the input resolution (based on width or height), the output resolution is considered equal to the input resolution.

  • true means check.

  • false means do not check.

  • Default value: false.

false

IsCheckResoFail

string

Whether to check the resolution. This value has a higher priority than IsCheckReso. If the output resolution is greater than the input resolution (based on width or height), transcoding is not performed, and the job fails directly.

  • true: Check.

  • false: Do not check.

  • Default value: false.

false

IsCheckVideoBitrate

string

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.

  • true means check.

  • false means do not check.

  • Default value: false.

false

IsCheckVideoBitrateFail

string

Whether to check the bitrate. If the output video bitrate is greater than the source video bitrate, transcoding is not performed, and the job fails directly. This value has a higher priority than IsCheckVideoBitrate.

  • true means check.

  • false means do not check.

  • Default value: false.

true

TransMode

string

Transcoding mode. Valid values:

  • onepass: Based on the One-Pass algorithm, with good accuracy.

  • twopass: Based on the Two-Pass algorithm, with lower accuracy.

  • CBR: Constant bit rate.

onepass

UserData

string

User-defined data.

example data

Video

object

Video configuration.

Remarque

If specified, this replaces the AliyunVideoCodec settings of the template specified by TemplateId.

Bitrate

string

Bitrate of the output video file. Unit: Kbps.

10

BitrateBnd

object

Average video bitrate range.

Max

string

Maximum total bitrate. Unit: Kbps.

20

Min

string

Minimum total bitrate. Unit: Kbps.

10

Bufsize

string

Buffer size.

  • Unit: Kb.

  • Default value: 6000.

1000

Codec

string

Codec format.

  • Supports H.264, H.265, GIF, WEBP.

  • Default value: H.264.

H.264

Crf

string

Rate-quality control factor.

  • If Crf is set, the Bitrate setting is ignored.

  • Default value: 23 for H.264 codec, 26 for H.265 codec.

22

Crop

string

Video frame cropping. Supports 2 methods:

  • Auto-detect and crop black bars: set to border.

  • Custom crop: parameter format is width:height:left:top.

1280:800:0:140

Degrain

string

Independent denoising algorithm strength.

5

Fps

string

Frame rate.

  • Unit: fps.

  • Valid range: 0-60. If the input file frame rate exceeds 60, it is set to 60.

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

60

Gop

string

Maximum time interval or maximum number of frames between keyframes. Unit: seconds (s).

  • Default value: 10s.

  • No unit for maximum number of frames.

1

Height

string

Height.

  • Unit: px.

  • Default value: Original video height.

1280

MaxFps

string

Maximum frame rate.

15

Maxrate

string

Peak video bitrate. Unit: Kbps.

10

Pad

string

Video padding with black bars.

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

  • Unit: px.

1280:800:0:140

PixFmt

string

Video color format.

  • Default value: yuv420p or original color format.

  • Valid values: yuv420p, yuvj420p, and other standard color formats.

    Remarque

    Non-standard color formats (such as yuvj420p(pc, bt470bg/bt470bg/smpte170m)) require compatibility configuration, otherwise transcoding will fail.

yuvj420p

Preset

string

Video algorithm preset. Default: medium. Valid values:

  • veryfast: Super fast.

  • fast: Fast.

  • medium: Medium.

  • slow: Slow.

  • slower: Slower.

veryfast

Profile

string

Encoding profile. Currently only supported for H.264. Default: high. Valid values:

Remarque

If you have multiple definitions, we recommend setting the lowest definition to baseline to ensure playback on low-end devices. Set other definitions to main or high.

  • baseline: For mobile devices.

  • main: For standard resolution devices.

  • high: For high resolution devices.

baseline

Qscale

string

Video quality control value.

15

ResoPriority

string

Resource priority.

1

ScanMode

string

Scan mode. Valid values:

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

  • auto: Automatic deinterlacing.

  • progressive: Progressive scan.

  • interlaced: Interlaced scan.

  • Default value: Empty, meaning not set.

Best practice: Although interlaced scanning saves more data than progressive scanning, its image quality is poor. Therefore, mainstream video production now uses progressive scanning.

  • If you set progressive or interlaced scan, but it does not match the original video mode, transcoding will fail.

  • We recommend setting it to the original video mode or automatic deinterlacing to improve compatibility.

interlaced

Width

string

Width.

  • Unit: px.

  • Default value: Original video width.

1080

VideoStreamMap

string

Video stream index.

  • Format: 0:a:{index}, for example, 0:a:0.

  • The index is the position in the audio stream list, starting from 0.

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

0:a:0

WaterMarkConfigUrl

string

Watermark configuration file URL.

http://example.com/configure

WaterMarkList

object

WaterMark

array<object>

Watermark list.

Remarque

If the watermark output is truncated or fails, check if your text watermark contains special characters. If it does, escape the special characters before passing them, or submit a ticket to Alibaba Cloud support for compatibility handling.

array<object>

Watermark details.

Dx

string

The horizontal offset of the watermark image relative to the output video. If set in the request, this value overrides the corresponding parameter in the watermark template. The default value is 0. The value can be in two forms:

  • Integer: Represents the offset in pixels.

    • Range: [8,4096].

    • Unit: px.

  • Decimal: Represents the ratio of the horizontal offset to the output video width.

    • Range: (0,1).

    • Supports up to four decimal places, for example, 0.9999. Any extra digits are discarded.

1

Dy

string

The vertical offset of the watermark image relative to the output video. If set in the request, this value overrides the corresponding parameter in the watermark template. The value can be in two forms:

  • Integer: Represents the vertical offset in pixels.

    • Range: [8,4096].

    • Unit: px.

  • Decimal: Represents the ratio of the vertical offset to the output video height.

    • Range: (0,1).

    • Supports up to four decimal places, for example, 0.9999. Any extra digits are discarded.

1

Height

string

Height of the watermark image. If set in the request, this value overrides the corresponding parameter in the watermark template. The value can be in two forms:

  • Integer: Represents the height in pixels.

    • Range: [8,4096].

    • Unit: px.

  • Decimal: Represents the ratio of the watermark height to the output video height.

    • Range: (0,1).

    • Supports up to four decimal places, for example, 0.9999. Any extra digits are discarded.

1280

InputFile

object

The watermark input file. Currently supports PNG images and MOV files as input.

Bucket

string

OSS bucket for the input file.

example-bucket

Location

string

OSS location for the input file.

oss-cn-hangzhou

Object

string

OSS object for the input file.

example-logo-****.png

ReferPos

string

The position of the watermark. If set in the request, this value overrides the corresponding parameter in the watermark template. Valid values:

  • TopRight: Top right.

  • TopLeft: Top left.

  • BottomRight: Bottom right.

  • BottomLeft: Bottom left.

TopRight

Type

string

Watermark type. If set in the request, this value overrides the corresponding parameter in the watermark template. For more information, see Parameter details. Valid values:

  • Image: Image watermark.

  • Text: Text watermark.

Image

WaterMarkTemplateId

string

Watermark template ID.

88c6ca184c0e47098a5b665e2a12****

Width

string

Width of the watermark image. If set in the request, this value overrides the corresponding parameter in the watermark template. The value can be in two forms:

  • Integer: Represents the width in pixels.

    • Range: [8,4096].

    • Unit: px.

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

    • Range: (0,1).

    • Supports up to four decimal places, for example, 0.9999. Any extra digits are discarded.

1080

Percent

integer

Transcoding progress.

100

PipelineId

string

Pipeline ID.

88c6ca184c0e47098a5b665e2a126797

State

string

Job status.

  • Submitted: The job has been submitted.

  • TranscodeFail: Transcoding failed.

Submitted

Message

string

Error message if job creation fails. This parameter is not returned if the job is created successfully.

The specified parameter "%s" cannot be null.

Success

boolean

Whether the operation was successful. Valid values:

  • true: Success.

  • false: Failure.

true

RequestId

string

L'identifiant de la requête.

25818875-5F78-4A45S71F6-D73936451234

Exemples

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

Codes d'erreur

Consultez Codes d'erreur pour la liste complète.

Notes de version

Consultez Notes de version pour la liste complète.