edit-icon download-icon

Parameter details

Last Updated: Jul 13, 2018

1. Input

Parameter Type Required Description
Bucket String Yes OSS bucket that stores the input file. You must assign the read and write permissions on this bucket to Media Processing on the bucket authorization page in the resource control channel of the console. This parameter complies with the OSS bucket definition. For more information, see the definition of “bucket” in the glossary.
Location String Yes Data center (also called OSS location) where the OSS bucket that stores the input file is located. This parameter complies with the OSS location definition. For more information, see the definition of “location” in the glossary.
Object String Yes Name of the input file (an OSS object), which must be subject to URL encoding and UTF-8 encoding. This parameter complies with the OSS object definition. For more information, see the definition of “object” in the glossary.

2. Output

Parameter Type Required Description
OutputObject String Yes Name of the output file (an OSS object), which must be subject to URL encoding and UTF-8 encoding.
Example of placeholder replacement: If the input file for transcoding is a/b/c.flv and OutputObject is set to %7BObjectPrefix%7D%7BFileName%7Dtest.mp4, then the output file is a/b/ctest.mp4.
The placeholder replacement rules are applicable to output file naming.
The following placeholders are supported by workflows: {ObjectPrefix} indicates the prefix of the input file name; {FileName}, the input file name; {ExtName}, the input file name extension; {DestMd5}, the MD5 value of the output file; {DestAvgBitrate}, the average bit rate of the output file; {RunId}, the ID of a media workflow execution instance; and {MediaId}, the ID of the media file processed by a workflow. These placeholders can be replaced dynamically.
The following placeholders are supported by non-workflows: {ObjectPrefix}, {FileName}, {ExtName}, {DestMd5}, and {DestAvgBitrate}.
Rules related to file name extension
Workflow: A file name extension is automatically appended to OutputObject according to the container format of the transcoding template.
Non-workflow: A file name extension is not automatically added. However, if the container type is M3U8, Media Processing automatically adds the file name extension .m3u8 to the playlist file name. For slice naming, the playlist file name is automatically added with a suffix of 5-digit serial number starting from 00001 (the serial number and playlist file name are connected by a hyphen). The file name extension is .ts.
For example, if the playlist file is filename.m3u8, the first slice .ts to be output is named in the format of filename-00001.ts.
TemplateId String Yes Transcoding template ID. Media Processing supports custom transcoding templates and preset transcoding templates.
WaterMarks WaterMark[] No A list of watermarks formatted as a JSON array. For more information, see “5. Transcoding watermark parameters.” The watermark array size limit is 20, indicating that up to 20 watermarks can be included in one output, for example:
[{
"InputFile":{
"Bucket":"example-bucket",
"Location":"oss-cn-hangzhou",
"Object":"example-logo.png"
},
"WaterMarkTemplateId":"88c6ca184c0e47098a5b665e2a126797"
}]
Clip String No Video clip, which is a JSON object. For more information, see “3. Clip.” Example:
{
"TimeSpan":{
"Seek":"123.45",
"Duration":"3.45"
}
}
Rotate String No Video rotation angle; value range: [0, 360). The rotation is clockwise.
Container String No If this parameter is set, it overwrites the Container parameter in the specified transcoding template. For more information, see “7. Container.”
Video String No If this parameter is set, it overwrites the Video parameter in the specified transcoding template. For more information, see 8. Video .
Audio String No If this parameter is set, it overwrites the Audio parameter in the specified transcoding template. For more information, see 10. Audio.
AudioStreamMap String No Audio stream sequence number. Format: 0:a:{sequence number}. The sequence starts with zero. The sequence number indicates the subscript of the audio streams list. Example: 0:a:0. If this parameter is not set, the default audio stream is selected.
TransConfig String No Transcoding process configuration. If this parameter is set, it overwrites the TransConfig parameter in the specified transcoding template. For more information, see “16. TransConfig.”
MergeList String No Merging setting, with up to four MergeURLs. For more information, see “27. Merging.”
Example of a single merged part: [{“MergeURL”:”http: //jvm.oss-cn-hangzhou.aliyuncs.com/tail_comm_01.mp4”}]<br/>Example of two merged parts:[{“MergeURL”:”http: //jvm.oss-cn-hangzhou.aliyuncs.com/tail_comm_01.mp4”,”Start”:”1”,”Duration”:”20”},{“MergeURL”:”http: //jvm.oss-cn-hangzhou.aliyuncs.com/tail_comm_02.mp4”,”Start”:”5.4”,”Duration”:”10.2”}]`
MergeConfigUrl String No MergeConfigUrl and MergeList are mutually exclusive. MergeConfigUrl indicates the URL of a merging configuration file, which supports up to 20 merged parts, for example, http://jvm.oss-cn-hangzhou.aliyuncs.com/mergeConfigfile. The merging configuration file must be stored in OSS and its access permission must be granted to Media Processing. For more information about the file content, see “27. Merging.” The following is the sample content of mergeConfigfile:
{
"MergeList":[{"MergeURL":"http://jvm.oss-cn-hangzhou.aliyuncs.com/tail_comm.mp4"}]
}
MuxConfig String No If this parameter is set, it overwrites the MuxConfig parameter in the specified transcoding template. For more information, see “17. MuxConfig.”
Priority String No Task priority in the MPS queue; value range: [1, 10]; default value: 6. The value 10 indicates the highest priority.
UserData String No Custom data, up to 1,024 bytes.
M3U8NonStandardSupport String No M3U8 custom parameter support. The parameter value is a JSON object. For more information, see “29. M3U8 custom parameters.” Example:
{
"TS":{"Md5Support":true,"SizeSupport":true}
}
Encryption String No Data encryption, which only supports output in M3U8 format
{
"Type":"hls-aes-128",
"Key":"ZW5jcnlwdGlvbmtleTEyMw",
"KeyType":"Base64",
"KeyUri":"aHR0cDovL2FsaXl1bi5jb20vZG9jdW1lbnQvaGxzMTI4LmtleQ=="
}
For more information, see “32. Encryption parameters.”
SubtitleConfig String No Subtitle configuration, which is a JSON object. For more information, see “33. SubtitleConfig.” Example:
{
“ExtSubtitleList”:[{
“Input”:{
“Bucket”:”example-bucket”,
“Location”:”oss-cn-hangzhou”,
“Object”:”example.srt”
},
“CharEnc”:”UTF-8”
}]
}
OpeningList String No Opening list, in JSON format. For more information, see “35. Opening.” Example: [{"OpenUrl":"http://test-bucket.oss-cn-hangzhou.aliyuncs.com/opening.flv","Start":"1","Width":"1920","Height":"1080"}]
TailSlateList String No Tail slate list, in JSON format. For more information, see “36. TailSlate.” Example: [{"TailUrl":"http://test-bucket.oss-cn-hangzhou.aliyuncs.com/tail.flv","Start":"1","BlendDuration":"2","Width":"1920","Height":"1080","IsMergeAudio":false,"BgColor":"White"}]
DeWatermark String NO Blurring watermark, JSON object. For more information, see DeWatermark 46.

3. Clip

Parameter Type Required Description
TimeSpan String No Time span of a clip. For more information, see “4. TimeSpan.”
ConfigToClipFirstPart Boolean No Whether to clip the first part.
false: (Default) Clip after merging
true: Merge after clipping the first part

4. TimeSpan

Parameter Type Required Description
Seek String No Start time, in the format of hh:mm:ss[.SSS] or sssss[.SSS]. In the former format, the value range is [00:00:00.000, 23:59:59.999]; in the latter format, the value range is [0.000, 86399.999]. Example: 01:59:59.999 or 32000.23.
Duration String No Duration, in the format of hh:mm:ss[.SSS] or sssss[.SSS]. In the former format, the value range is [00:00:00.000, 23:59:59.999]; in the latter format, the value range is [0.000, 86399.999]. Example: 01:00:59.999 or 32000.23.
End String No Duration truncated in the end. The Duration parameter is invalid if this parameter is set. The parameter value is in the format of hh:mm:ss[.SSS] or sssss[.SSS]. In the former format, the value range is [00:00:00.000, 23:59:59.999]; in the latter format, the value range is [0.000, 86399.999]. Example: 01:00:59.999 or 32000.23.

5. Transcoding watermark parameters

Parameter Type Required Description
WaterMarkTemplateId String No Watermark template ID. If this parameter is not set, the following default settings are applied: The watermark position is TopRight; offsets Dx and Dy are 0; the watermark width is 0.12 times the resolution width of the output video; the watermark height scales proportionally relative to watermark width.
InputFile String Yes Input watermark file. For more information, see the description of InputFile. Currently, images in PNG format and files in MOV format can be input as watermarks.
Width String No If this parameter is set, it overwrites the watermark width setting of the watermark template. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the watermark image width in pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates a ratio relative to the resolution width of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
Height String No If this parameter is set, it overwrites the watermark height setting of the watermark template. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the watermark image height in pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates a ratio relative to the resolution height of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
Dx String No If this parameter is set, it overwrites the Dx parameter of the watermark template. This parameter indicates the horizontal offset of the watermark image relative to the output video. The default value is 0. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the number of offset pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates the ratio of horizontal offset to the resolution width of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
Dy String No If this parameter is set, it overwrites the Dy parameter of the watermark template. This parameter indicates the vertical offset of the watermark image relative to the output video. The default value is 0. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the number of offset pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates the ratio of vertical offset to the resolution height of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
ReferPos String No If this parameter is set, it overwrites the ReferPos parameter of the watermark template. It indicates the watermark position and can be set to TopRight, TopLeft, BottomRight, or BottomLeft.
Type String No If this parameter is set, it overwrites the Type parameter of the watermark template. It indicates the watermark type and can be set to Image (image watermark) or Text (text watermark). The default value is Image. If it is set to Text, the TextWaterMark parameter must be set.
Timeline String No If this parameter is set, it overwrites the Timeline parameter of the watermark template. It indicates a dynamic watermark. For more information, see the description of Timeline.
TextWaterMark String No Text watermark configuration, which is a JSON object. This parameter must be set if Type is set to Text. For more information, see “37. Text watermark parameters.” Example: {“Content”:”5rWL6K+V5paH5a2X5rC05Y2w”,”Top”:2,”Left”:10}

6. Watermark template configuration

Parameter Type Required Description
Width String No Width of the watermark image in the output video. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the watermark image width in pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates a ratio relative to the resolution width of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
Height String No Height of the watermark image in the output video. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the watermark image height in pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates a ratio relative to the resolution height of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
Dx String No Horizontal offset of the watermark image relative to the output video. The default value is 0. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the number of offset pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates the ratio of horizontal offset to the resolution width of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
Dy String No Vertical offset of the watermark image relative to the output video. The default value is 0. The parameter value can be an integer or a decimal number. In integer form, this parameter indicates the number of offset pixels; the value range is [8, 4096], in the unit of px. In decimal number form, this parameter indicates the ratio of vertical offset to the resolution height of the output video; the value range is (0, 1). Up to four digits are allowed after the decimal point, for example, 0.9999, and excessive digits are automatically dropped.
ReferPos String No Watermark position. This parameter can be set to TopRight, TopLeft, BottomRight, or BottomLeft. The default value is TopRight.
Type String No Watermark type. This parameter can be set to Image or Text. The default value is Image. Currently, only the Image type is supported.
Timeline String No Dynamic watermark. For more information, see the description of Timeline.

Description of the Width and Height parameters:

  • When neither the Width nor the Height parameter is set, the watermark width is 0.12 times the resolution width of the output video and the watermark height scales proportionally according to the aspect ratio of the original watermark image.
  • When either the Width or the Height parameter is set, the unspecified side scales proportionally according to the aspect ratio of the original watermark image.
  • When the Width and Height parameters are set, the watermark image is set based on actual values.

Description of watermark coordinates:

Watermark position

7. Container

Parameter Type Required Description
Format String No Container format. The default value is mp4.
- video transcoding supports the FLV, MP4, HLS(m3u8+ts)and MPEG-DASH(MPD+fMP4)formats,
- audio transcoding supports the MP3, MP4, OGG, FLAC, and m4a formats,
- image supports gif and webp formats,
When the container format is gif, Video Codec can only be set as GIF.
When the container format is webp, Video Codec can only be set as WEBP.
When the container format is flv, Video Codec cannot be set as H.265.

8. Video

Parameter Type Required Meaning Description
Codec String No Codec format Optional values: H.264, H.265, GIF and WEBP; default value: H.264.
Profile String No Encoding level Optional values: baseline, main, and high; default value: high.
baseline: applicable to mobile devices
main: applicable to standard-definition (SD) devices
high: applicable to high-definition (HD) devices
Best practice: If multiple definitions exist, we recommend that you set Profile to baseline for the lowest definition to guarantee normal play on low-end devices, and set Profile to main or high for other definitions.
Currently, this parameter is only supported by H.264.
Bitrate String No Bit rate of the output video file Value range: [10, 50000], in Kbps.
Crf String No Bit rate, which is a quality control factor Value range: [0, 51]; default value: 26. The Bitrate parameter is invalid if the Crf parameter is set.
Width String No Width Value range: [128, 4096], in px. The default value is the original video width.
Height String No Height Value range: [128, 4096], in px. The default value is the original video height.
Fps String No Frame rate Value range: (0, 60], in fps. The default value is the frame rate of the input file. If the frame rate of the input file is greater than 60, the value still takes 60.
Gop String No Maximum time interval or maximum number of frames between two key frames Value range: [1, 100000]; default value: 250.Maximum time interval, the unit second is required to be entered, default value: 10s
Maximum number of frames between two key frames: no unit, value range: [1,100000]
Preset String No Preset video algorithm Optional values: veryfast, fast, medium, slow, and slower; default value: medium.
Currently, this parameter is only supported by H.264.
ScanMode String No Scan mode Optional values: interlaced and progressive.
Bufsize String No Size of the buffer area Value range: [1000, 128000]; default value: 6000, in Kb.
Maxrate String No Peak video bit rate Value range: [10, 50000], in Kbps.
PixFmt String No Video color format Optional values: yuv420p, yuvj420p, and other standard color formats; default value: yuv420p or original color format.
Remove String No Whether to delete video streams Optional values: true (delete video streams) and false (retain video streams); default value: false.
Crop String No Video cropping Two cropping methods are supported. (1) Automatically detect and crop black borders (Crop is set to “border”); (2) Custom cropping, in which case the parameter value is in the format of width:height:left:top. Example: 1280:800:0:140
Pad String No Pad video with black borders Parameter value format: width:height:left:top. Example: 1280:800:0:140

The following table lists the supported combinations of video transcoding codec formats and container formats.

Container Audio Codecs Video Codecs
FLV AAC and MP3 H.264
MP4 AAC and MP3 H.264 and H.265
tS AAC and MP3 H.264 and H.265
M3U8 AAC and MP3 H.264 and H.265
GIF Not supported GIF

The following table lists the supported combinations of video codec formats and video stream parameters.

Video/Codec H.264 H.265 GIF
Profile Y N N
Bitrate Y Y N
Crf Y Y N
Width Y Y Y
Height Y Y Y
Fps Y Y Y
Gop Y Y N
Preset Y N N
ScanMode Y Y Y
Bufsize Y Y N
Maxrate Y Y N
PixFmt Y Y bgr8

10. Audio

Parameter Type Required Description
Codec String No Audio codec format; optional values: AAC, MP3, VORBIS, and FLAC; default value: AAC.
Profile String No Preset audio encoding; optional values when Codec is set to AAC: aac_low, aac_he, aac_he_v2, aac_ld, and aac_eld.
Samplerate String No Sampling rate, in Hz; optional value: 22050, 32000, 44100, 48000, and 96000; default value: 44100.
When the video container format is FLV and the audio codec format is MP3, Samplerate cannot be set to 32000, 48000, or 96000. When the audio codec format is MP3, Samplerate cannot be set to 96000.
Bitrate String No Audio bit rate of the output file, in Kbps; value range: [8, 1000]; default value: 128.
Channels String No Number of sound channels; default value: 2. It can be set to either 1 or 2 when Codec is set to mp3; or can be set to 1, 2, 4, 5, 6, or 8 when Codec is set to acc.
Remove String No Whether to delete audio streams; optional values: true (delete audio streams) and false (retain audio streams); default value: false.

The following table lists the supported combinations of audio transcoding codec formats and container formats.

Container Audio Codecs
mp3 MP3
mp4 AAC
ogg VORBIS and FLAC
flac FLAC

11. SnapshotConfig

Parameter Type Required Description
OutputFile String No Output file, which is a JSON object. For more information, see “38. Screenshot OutputFile.”
Time String Yes Screenshot time, in ms
Interval String No Screenshot interval, in seconds; default value: 10. If this parameter is set, screenshots are taken in sequence asynchronously. The value must be greater than 0. If Interval is set to 0, screenshots are taken at even intervals based on the video duration.
Num String No Screenshot quantity. If this parameter is set, screenshots are taken in sequence asynchronously. The value must be greater than 0. When the duration calculated by Time + Interval x Num exceeds the video duration, screenshots are no longer taken beyond the calculated duration and the number of actual screenshots taken is returned. When Num is set to 1, the Interval parameter is ignored and a single screenshot is taken asynchronously.
Width String No Width of the output screenshot image, in px; value range: [8, 4096]
Height String No Height of the output screenshot image, in px; value range: [8, 4096]
FrameType String No Screenshot type; optional values: normal (normal frame) and intra (I frame); default value: intra

14. Segment

Parameter Type Required Description
Duration String No Segment time length, expressed as an integer; value range: [1, 60], in seconds.
ForceSegTime String No A list of up to 10 segment time points, which are expressed as integers and separated by commas (,). The unit is seconds. For example, 23,55,60 indicates processing segments at the 23th, 55th, and 60th seconds.

16. TransConfig

Parameter Type Required Description
TransMode String No Transcoding mode; optional values: onepass, twopass, and CBR; default value: onepass.
AdjDarMethod String No Resolution rewrite mode; optional values: rescale, crop, pad, and none; default value: none
IsCheckReso String No Whether to check resolution. The output resolution is equal to the input resolution if the former is greater than the latter (which is determined based on width or height). Optional values: true (check resolution) and false (not check resolution); default value: false.
IsCheckResoFail String No Whether to check resolution. An error indicating transcoding failure is returned if the output resolution is greater than the input resolution (which is determined based on width or height). Optional values: true (check resolution) and false (not check resolution); default value: false.
IsCheckVideoBitrate String No Whether to check the video bit rate. The output video bit rate is equal to the input video bit rate if the former is greater than the latter. Optional values: true (check resolution) and false (not check resolution); default value: false.
IsCheckAudioBitrate String No Whether to check the audio bit rate. The output audio bit rate is equal to the input audio bit rate if the former is greater than the latter. Optional values: true (check resolution) and false (not check resolution); default value: false.
isCheckAudioBitrateFail String No This parameter indicates the processing when the output audio bit rate is greater than the media source audio bit rate. If it is set to “true”, transcoding is not performed; if it is set to “false”, checking is not performed. This parameter takes precedence over IsCheckAudioBitrate.
isCheckVideoBitrateFail String No This parameter indicates the processing when the output video bit rate is greater than the media source video bit rate. If it is set to “true”, transcoding is not performed; if it is set to “false”, checking is not performed. This parameter takes precedence over IsCheckVideoBitrate.

Position of the AdjDarMethod parameter: 2

17. MuxConfig

Parameter Type Required Description
Segment String No Segment configuration, which is a JSON object. For more information, see “14. Segment.” Example:
{
"Duration":"34"
}

18. NotifyConfig

Parameter Type Required Description
QueueName String No MNS queue created in Alibaba Cloud Message Service. Media Processing allows you to bind an MNS queue to an MPS queue. After a task is executed in the MPS queue, the results are sent to the bound MNS queue. For more information about how to acquire messages in the MNS queue, see Queue message operation. Before you configure an MNS queue in the MPS queue, create the MNS queue in Message Service.
Topic String No Topic created in Alibaba Cloud Message Service. Media Processing allows you to bind a topic to an MPS queue. After a task is executed in the MPS queue, the results are sent to the bound topic and then the topic pushes the results in the form of a message to the subscribed address. Before you configure a topic in a message queue, create a topic in Message Service. This function is currently under a public beta test.

19. Transcoding task input

Parameter Type Required Description
Bucket String Yes OSS bucket that stores the input file. You must assign the read and write permissions on this bucket to Media Processing on the bucket authorization page in the resource control channel of the console. This parameter complies with the OSS bucket definition. For more information, see the definition of “bucket” in the glossary.
Location String Yes Data center (also called OSS location) where the OSS bucket that stores the input file is located. This parameter complies with the OSS location definition. For more information, see the definition of “location” in the glossary.
Object String Yes Name of the input file (an OSS object), which must be subject to URL encoding and UTF-8 encoding. This parameter complies with the OSS object definition. For more information, see the definition of “object” in the glossary.
Audio String No Audio configuration of the source media file, which is a JSON object. This parameter must be set when the input file is in ADPCM or PCM format. For more information, see see “21. InputAudio.” Example:
{
"Channels":"2",
"Samplerate":"44100"
}
Container String No Container configuration of the source media file, which is a JSON object. This parameter must be set when the input file is in ADPCM or PCM format. For more information, see “20. InputContainer.” Example:
{
"Format":"u8"
}

20. InputContainer

Parameter Type Required Description
Format String Yes Source media audio format; optional values: alaw, f32be, f32le, f64be, f64le, mulaw, s16be, s16le, s24be, s24le, s32be, s32le, s8, u16be, u16le, u24be, u24le, u32be, u32le, and u8

21. InputAudio

Parameter Type Required Description
Channels String Yes Number of source media audio channels; value range: [1, 8]
Samplerate String Yes Source media audio sampling rate; value range: (0, 320000], in Hz

22. AnalysisConfig

Parameter Type Required Description
QualityControl String No Output quality control, which is a JSON object. For more information, see “23. QualityControl.”
PropertiesControl String No Attribute control, which is a JSON object. For more information, see “24. PropertiesControl.”

23. QualityControl

Parameter Type Required Description
RateQuality String No Output quality level, expressed as an integer; value range: (0, 51]; default value: 25
MethodStreaming String No Play mode; optional values: network and local; default value: network

24. PropertiesControl

Parameter Type Required Description
Deinterlace String No Forced scan mode determination,
Auto: Automatic;
Force: Force the Deinterlace action; None: Disable the Deinterlace action
Crop String No Video cropping configuration; default value: Auto. The Mode parameter is required if this parameter is set (not a blank JOSN{}). For more information, see “25. Crop.”

25. Crop

Parameter Type Required Description
Mode String No Optional values: Auto (automatic), Force (force the Crop action), and None (disable the Crop action). This parameter is required if the Crop parameter is set (not a blank JOSN{}).
Width Integer No Width after cropping; value range: [8, 4096]. This parameter is invalid if Mode is set to Auto or None.
Height Integer No Height after cropping; value range: [8, 4096]. This parameter is invalid if Mode is set to Auto or None.
Top Integer No Top margin for cropping; value range: [8, 4096]. This parameter is invalid if Mode is set to Auto or None.
Left Integer No Left margin for cropping; value range: [8, 4096]. This parameter is invalid if Mode is set to Auto or None.

26. TransFeatures

Parameter Type Required Description
MergeList String No Video merging setting, which is formatted as a JSON array. Up to four MergeURLs are supported. For more information, see “27. Merging.” Example: [{“MergeURL”:”http: //example-bucket.oss-cn-hangzhou.aliyuncs.com/k/mp4.mp4”},{“MergeURL”:”http: //example-bucket.oss-cn-hangzhou.aliyuncs.com/c/ts.ts”,”Start”:”1:14”,”Duration”:”29”}]

27. Merging

Parameter Type Required Description
MergeURL String Yes Merged part address, for example, http: //example-bucket.oss-cn-hangzhou.aliyuncs.com/example-object.flv. The object name must be subject to URL encoding and UTF-8 encoding.
Start String No Start time, in the format of hh:mm:ss[.SSS] or sssss[.SSS]; example: 01:59:59.999 or 32000.23
Duration String No Duration, in the format of hh:mm:ss[.SSS] or sssss[.SSS]; example: 01:59:59.999 or 32000.23

28. Task output file

Parameter Type Required Description
URL String No OSS URL of the input file, for example, http: //example-bucket.oss-cn-hangzhou.aliyuncs.com/example.flv. The Bucket, Location, and Object parameters are required if this parameter is not set.
Bucket String No OSS bucket that stores the output file. You must assign the read and write permissions on this bucket to Media Processing on the bucket authorization page in the resource control channel of the console. This parameter complies with the OSS bucket definition. For more information, see the definition of “bucket” in the glossary. This parameter is required if the URL parameter is not set; if the URL parameter is set, this parameter is invalid.
Location String No Data center (also called OSS location) where the OSS bucket that stores the output file is located. This parameter complies with the OSS location definition. For more information, see the definition of “location” in the glossary. This parameter is required if the URL parameter is not set; if the URL parameter is set, this parameter is invalid.
Object String No Name of the output file (an OSS object), which must be subject to URL encoding and UTF-8 encoding. This parameter complies with the OSS object definition. For more information, see the definition of “object” in the glossary. This parameter is required if the URL parameter is not set; if the URL parameter is set, this parameter is invalid.

29. Support for M3U8 custom parameters

Parameter Type Required Description
TS String No Custom parameter support related to TS files. The parameter value is a JSON object. For more information, see “30. TS parameter support.”

30. TS parameter support

Parameter Type Required Description
Md5Support Boolean No Whether to support TS-specific MD5 value output to M3U8 files
SizeSupport Boolean No Whether to support TS file size output to M3U8 files

31. Timeline parameters

Parameter Type Required Description
Start String No Start time of watermark appearance, which is an integer in seconds; default value: 0
Duration String No Duration when the watermark persists; value range: [number, ToEND]; default value: ToEND

32 Encryption parameters

Parameter Type Required Description
Type String Yes Value: hls-aes-128
Key String Yes Video encryption key. The parameter value must be encrypted using the method indicated by the KeyType parameter. For example, if the key is “encryptionkey128”, it is encrypted into (“encryptionkey128”) by Base64 or into (Base64(“encryptionkey128”)) by KMS.
KeyUri String Key Key access URL, which is encrypted by Base64
KeyType String Yes The encryption key must be encrypted by Base64 or KMS when being transferred to Media Processing. If you use KMS, contact us to acquire the primary key. Base64 is the basic encryption mode, whereas KMS performs encryption based on Base64.

33. SubtitleConfig

Parameter Type Required Description
ExtSubtitleList ExtSubtitle[] No A list of up to four external subtitles, which is a JSON array. For more information, see “34. ExtSubtitle.” Example:
[
{
“Input”:{
“Bucket”:”example-bucket”,
“Location”:”oss-cn-hangzhou”,
“Object”:”example.srt”
},
“CharEnc”:”UTF-8”
}
]

34. ExtSubtitle

Parameter Type Required Description
Input String Yes External input subtitle file, which is a JSON object. The supported formats include SRT and ASS. For more information, see “1. Input.” Example:
{
“Bucket”:”example-bucket”,
“Location”:”oss-cn-hangzhou”,
“Object”:”example.srt”
}
Currently, {ObjectPrefix}, {FileName}, and {ExtName} can be dynamically replaced. For example, if the input file object for transcoding is a/b/c/test.flv, the subtitle file can be expressed as {ObjectPrefix}{FileName}-cn.srt based on dynamic rules. URL encoding is required. The Object parameter is set to %7bObjectPrefix%7d%7bFileName%7d-cn.srt. Media Processing considers the path to the external subtitle file address as a/b/c/test-cn.srt.
CharEnc String No External subtitle character encoding; optional values: UTF-8, GBK, BIG5, and Auto; default value: Auto. A check error may occur if this parameter is set to Auto; We recommend that you specify a character encoding method.

35. Opening

Parameter Type Required Description
OpenUrl String Yes Opening URL, which is an OSS address
Start String No Start time; default value: 0
Width String No Width; optional values: (0, 4096), -1, and full. -1 indicates the value of the program source, and “full” indicates filling up the screen. The default value is -1.
Height String No Height; optional values: (0, 4096), -1, and full. -1 indicates the value of the program source, and “full” indicates filling up the screen. The default value is -1.

36. TailSlate

Parameter Type Required Description
TailUrl String Yes Tail slate URL, which is an OSS address
Start String No Start time; default value: 0
BlendDuration String No Fade-in time; default value: 0
Width String No Width; optional values: (0, 4096), -1, and full. -1 indicates the value of the program source, and “full” indicates filling up the screen. The default value is -1.
Height String No Height; optional values: (0, 4096), -1, and full. -1 indicates the value of the program source, and “full” indicates filling up the screen. The default value is -1.
IsMergeAudio Boolean No Whether to merge sample audios; default value: true
BgColor String No Background color; default color: White. For more information, see bgcolor.

37. Text watermark parameters

Parameter Type Required Description
Content String Yes Text watermark content, which must be Base64 encoded. For example, if you want to add the text watermark “test text watermark”, set this parameter to 5rWL6K+V5paH5a2X5rC05Y2w.
FontName String No Supported font; default value: “SimSun”
FontSize Int No Font size; value range: (4, 120), default value: 16
FontColor String No Font color. For more information about the optional values, see FontColor.
FontAlpha Int No Font transparency; value range: (0, 1]; default value: 1.0
Top Int No Top margin of the text; value range: [0,]; default value: 0
Left Int No Left margin of the text; value range: [0,]; default value: 0
BorderWidth Int No Stroke width; value range: [0,]; default value: 0
BorderColor String No Stroke color; default value: Black. For more information about the optional values, see BorderColor.

38. Screenshot OutputFile

Parameter Type Required Description
Bucket String Yes OSS bucket that stores the output screenshot file. This parameter complies with the OSS bucket definition. For more information, see the definition of “bucket” in the glossary.
Location String Yes Data center (also called OSS location) where the OSS bucket that stores the output screenshot file is located. This parameter complies with the OSS location definition. For more information, see the definition of “location” in the glossary.
Object String Yes Name of the output screenshot file (an OSS object), in JPG format, which must be subject to URL encoding and UTF-8 encoding.
Example of placeholder replacement: If the input screenshot file is a/b/c.flv and Object is set to %7BObjectPrefix%7D%7BFileName%7D%7BCount%7D.jpg, then the output screenshot files are a/b/c00001.jpg, a/b/c00002.jpg, and so on.
The placeholder replacement rules are applicable to output screenshot file naming.
The following placeholders are supported by workflows: {ObjectPrefix} indicates the prefix of the input file name; {FileName}, the input file name; {ExtName}, the input file name extension; {SnapshotTime}, the screenshot taking time; {Count}, a specific screenshot in a batch of screenshot files; {RunId}, the ID of a media workflow execution instance; and {MediaId}, the ID of the media file processed by a workflow. These placeholders can be replaced dynamically.
The following placeholders are supported by non-workflows: {ObjectPrefix} indicates the prefix of the input file name; {FileName}, the input file name; {ExtName}, the input file name extension; {SnapshotTime}, the screenshot taking time; {Count}, a specific screenshot in a batch of screenshot files.
Batch screenshot taking:
If screenshots are taken in sequence asynchronously and Num is not set to 1, then Object of OutputFile must contain %7BCount%7D to identify the addresses of multiple screenshot images that are taken in sequence. If three screenshot images are output and Object of OutputFile is %7BCount%7D.jpg, then the output images (indicated by Object) are 00001.jpg, 00002.jpg, and 00003.jpg in sequence.

39 TileOut

Parameter Type Required Description
Lines String No Picture-tiling lines, the whole line, value range: (0,10000], default value: 10
Columns String No Picture-tiling columns, the whole column, value range: (0,10000], default value: 10
CellWidth String No The width of a single picture, which is the width of the screenshot output resolution by default.
CellHeight String No The height of a single picture, which is the height of the screenshot output resolution by default.
Margin String No The width of the margin, default value: 0, unit: px.
Padding String No The picture space, default value: 0, unit: px.
Color String No Background color, value range: color keyword, random; default value: black. Color keyword supports three formats. For example, for black, “Black”, “black” and “#000000” are supported.
IsKeepCellPic String No Whether the picture is kept. Value range: true, false, default value: true.

40 MultiBitrateVideoStream

Name Type Required Description
URI String No The output name of the video bitstream, which must end with .m3u8. For example, a/b/test.m3u8, format: ^[a-z]{1}[a-z0-9./-]+$

41 ExtXMedia

Parameter Type Required Description
Name String Yes Required, description, corresponding to NAME of HLS V5 protocol, 64 bytes at most, UTF-8.
Language String No Optional, language type, RFC5646, corresponding to LANGUAGE of HLS V5 protocol.
URI String Yes Required, resource path. For example, a/b/c/d/audio-1.m3u8, format: ^[a-z]{1}[a-z0-9./-]+$

42 MasterPlayList

Parameter Type Required Description
MultiBitrateVideoStreams JsonArray Yes Multi-bitstream array. For more information, see 43 MultiBitrateVideoStream. For example, [{“RefActivityName”: “video-1”,”ExtXStreamInfo”: {“BandWidth”: “111110”,”Audio”: “auds”,”Subtitles”: “subs” }}]

43 MultiBitrateVideoStream

Parameter Type Required Description
RefActivityName String Yes The name of the associated activity.
ExtXStreamInfo Json Yes The bitstream feature. For more information, see 44 ExtXStreamInfo. For example, {“BandWidth”: “111110”,”Audio”: “auds”,”Subtitles”: “subs” }

44 ExtXStreamInfo

Parameter Type Required Description
BandWidth String Yes Bandwidth, the upper limit of the total bitrate, required, which corresponds to BANDWIDTH of HLS V5 protocol.
Audio String No The ID of the audio streams group, optional, which corresponds to AUDIO of HLS V5 protocol.
Subtitles String No The ID of the subtitile stream groups, optional, which corresponds to SUBTITLES of HLS V5 protocol.

45 SubOut Webvtt

Parameter Type Required Description
IsSptFrag String No Whether the picture is tiled out. True indicates tiling out. Default value: false

46 DeWatermark

JSON:

  1. "0": [
  2. {
  3. "L": 10,
  4. "T": 10,
  5. "W": 10,
  6. "H": 10
  7. },
  8. {
  9. "L": 100,
  10. "T": 0.1,
  11. "W": 10,
  12. "H": 10
  13. }
  14. ],
  15. "128000": [],
  16. "250000": [
  17. {
  18. "L": 0.2,
  19. "T": 0.1,
  20. "W": 0.01,
  21. "H": 0.05
  22. }
  23. ]
  24. }

pts: Character, indicating the timestamp of object frame. Unit: millisecond (s).

  • L: Number, indicating the left margin of the region to be blurred.

  • T: Number, indicating the top margin of the region to be blurred.

  • W: Number, indicating the width of the region to be blurred.

  • H: Number, indicating the height of the region to be blurred.

When values of T, L, W and H are larger than one, they indicate absolute pixel value. Otherwise, they indicates percentage values corresponding to source video resolution. Whether the values of T, L, W and H are percentage values or absolute values, they are rounded down in the final treatment.

In the previous demo, the corresponding descriptions of the pts(0, 128000, 250000)are as follows:

  • Starting from 0ms, the system performs dewatermarking treatment on the Logo which is 10✖️10 pixel in size and 10X10 pixel from the upper-left corner, as well as on the Logo which is 10X10 pixel in size and has a left margin of 100 pixel and top margin of 0.1✖️(src_height).

  • Until 128000ms, the system doesnot stop performing dewatermarking treatment on the Logo, that is, [0~128000] is the time range when the Logo is blurred.

  • Starting from 250000ms, the system performs dewatermarking treatment on the Logo which is 0.01✖️(src_width) in width, 0.05✖️(src_height) in height, and has a left margin of 0.2✖️(src_width) and top margin of 0.1✖️(src_height).

Thank you! We've received your feedback.