EncryptConfig
Parameter |
Type |
Required |
Description |
CipherText |
String |
Yes |
The ciphertext key used to obtain the plaintext key. |
DecryptKeyUri |
String |
Yes |
The URL used to obtain the decryption key based on the ciphertext key. For example:http://decrypt.demo.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt |
KeyServiceType |
String |
Yes |
The type of the key service. Default value: KMS. |
Example of the EncryptConfig parameter
{
"CipherText":"ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt",
"DecryptKeyUri":"http://decrypt.demo.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt",
"KeyServiceType":"KMS"
}
OverrideParams
Parameter |
Type |
Required |
Description |
Watermarks |
Watermark[] |
No |
The required parameter for watermark replacement. |
SubtitleSetting |
SubtitleSetting |
No |
The required parameter for subtitle replacement. |
TranscodeTemplateList |
TranscodeTemplate[] |
No |
The required parameter for template parameter replacement.- The Video, Audio, Clip, Rotate, and TranscodeFileRegular parameters in the TranscodeTemplate structure can be replaced.
- If the Definition parameter in the TranscodeTemplate structure is set to OD, no parameter can be replaced.
- During parameter replacement, the TranscodeTemplateId parameter is required.
|
Note: Currently, you can replace only the file URL of an image watermark or the content of a text watermark.
Example of the TranscodeTemplateList parameter
[
{
"TranscodeTemplateId":"9580424e49b28c952a46544e3e8f2268",
"Video":{
"Width":720,
"Height":480,
"Bitrate":"600"
},
"Audio":{
"Bitrate":128
},
"Clip":{
"TimeSpan":{
"Seek":"1"
"Duration":"5"
},
"Rotate":"270",
"TranscodeFileRegular":"{MediaId}/{JobId}/{PlayDefinition}"
}
}
]
Watermark
Parameter |
Type |
Required |
Description |
WatermarkId |
String |
Yes |
The watermark ID associated with the specified transcoding template. To view the watermark ID, log on to the ApsaraVideo for VOD console and choose Global Settings > Watermarks in the left-side navigation pane. |
FileUrl |
String |
No |
The OSS URL of the watermark file. This parameter is required for an image watermark. For more information about how to obtain the OSS URL of a watermark file, see CreateUploadAttachedMedia. |
Content |
String |
No |
The content of the text watermark. This parameter is required for a text watermark. |
Note: The value of the FileUrl parameter must be the URL of the origin that stores the video mezzanine file to be transcoded.
SubtitleSetting
Parameter |
Type |
Required |
Description |
SubtitleList |
Subtitle |
Yes |
The list of the subtitles to be replaced. |
Subtitle
Parameter |
Type |
Required |
Description |
SubtitleUrl |
String |
Yes |
The OSS URL of the subtitle file. (The HTTPS URL is not supported.) |
CharEncode |
String |
Yes |
The subtitle encoding format. Valid values: |
Note: We recommend that you set the CharEncode parameter to the proper value. If you set the CharEncode parameter to auto, the detected encoding format may be incorrect.
Example of the OverrideParams parameter
{
"Watermarks":[
{
"WatermarkId":"watermark1",
"FileUrl":"http://test.bucket.aliyuncs.com/image/replace.png"
},
{
"WatermarkId":"watermark2",
"Content": "Watermark test"
}
],
"SubtitleSetting":{
"SubtitleList":[
{
"SubtitleUrl":"http://outin-40564284ef051100163e1403e7.oss-cn-shanghai.aliyuncs.com/subtitles/7b850b-724c-4011-b885-dd16cc112.ass",
"CharEncode":"UTF-8"
},
{
"SubtitleUrl":"http://outin-40564284ef0511e0163e1403e7.oss-cn-shanghai.aliyuncs.com/subtitles/7b86db-724c-4011-b885-dd161d1cyy.srt",
"CharEncode":"auto"
}
]
}
}
WatermarkConfig
Image watermark
Parameter |
Type |
Required |
Description |
Dx |
String |
Yes |
The lateral offset of the watermark. Valid values: Pixel value: [8,4096]. Image ratio: (0,1). |
Dy |
String |
Yes |
The longitudinal offset of the watermark. Valid values: Pixel value: [8,4096]. Image ratio: (0,1). |
Width |
String |
Yes |
The width of the watermark. Valid values: Pixel value: [8,4096]. Image ratio: (0,1). |
Height |
String |
Yes |
The height of the watermark. Valid values: Pixel value: [8,4096]. Image ratio: (0,1). |
ReferPos |
String |
Yes |
The display position of the watermark. Valid values: BottomRight, BottomLeft, TopRight, and TopLeft. |
Timeline |
Timeline |
No |
The timeline of watermark display, including the start time and end time. The value is a JSON-formatted string. |
Note: The Timeline parameter is valid only for an image watermark.
Text watermark
Parameter |
Type |
Required |
Description |
Content |
String |
Yes |
The content of the text watermark, for example, “Text watermark.” |
FontName |
String |
No |
The name of the font. |
FontColor |
String |
No |
The color of the font. |
FontAlpha |
String |
No |
The transparency of the font. Valid values: (0,1]. Default value: 1.0. |
BorderColor |
String |
No |
The color of the font outline. |
Top |
Integer |
No |
The top margin of the text watermark. Default value: 0. Valid values: [0,4096]. |
Left |
Integer |
No |
The left margin of the text watermark. Default value: 0. Valid values: [0,4096]. |
FontSize |
Integer |
No |
The size of the font. Default value: 16. Valid values: (4,120). |
BorderWidth |
Integer |
No |
The outline width. Default value: 0. Valid values: [0,4096]. |
Timeline
Parameter |
Type |
Required |
Description |
Start |
String |
Yes |
The start time for watermark display. The value is a number. Unit: seconds. Default value: 0. |
Duration |
String |
Yes |
The duration of watermark display. Unit: seconds. Valid values: [Number,ToEND]. Default value: ToEND (indicating that the watermark is displayed until the video ends). |
Note: The Timeline parameter is valid only for an image watermark.
SnapshotTemplateConfig
Parameter |
Type |
Required |
Description |
SnapshotType |
String |
Yes |
The type of the snapshot. Valid values: NormalSnapshot and SpriteSnapshot. |
SnapshotConfig |
SnapshotConfig |
Yes |
The snapshot configuration. The value is a JSON-formatted string. The snapshot configuration varies depending on the snapshot type. |
SnapshotConfig
Parameter |
Type |
Required |
Description |
FrameType |
String |
Yes |
The frame type of the snapshot. Valid values: intra (indicating keyframes) and normal (indicating normal frames). |
Count |
Long |
Yes |
The number of snapshots to be taken. |
Interval |
Long |
Yes |
The snapshot interval. The value must be greater than or equal to zero. Unit: seconds. If you set this parameter to 0, snapshots are taken at even intervals based on the video duration divided by the value of the Count parameter. |
SpecifiedOffsetTime |
Long |
Yes |
The start time of the specified snapshot time period. Unit: milliseconds. |
Width |
Integer |
No |
The width of the snapshot. Valid values: [8,4096]. Default value: the width of the video mezzanine file. Unit: pixels. |
Height |
Integer |
No |
The height of the snapshot. Valid values: [8,4096]. Default value: the height of the video mezzanine file. Unit: pixels. |
SpriteSnapshotConfig |
SpriteSnapshotConfig |
No |
The sprite snapshot configuration. This parameter is required for sprite snapshots. |
Note: Because sprite snapshots are composed of normal snapshots, the SnapshotConfig parameter is required for both normal snapshots and sprite snapshots.
SpriteSnapshotConfig
Parameter |
Type |
Required |
Description |
CellWidth |
String |
No |
The width of the original snapshots that compose the sprite snapshot. Default value: the width of the original normal snapshot. Unit: pixels. |
CellHeight |
String |
No |
The height of the original snapshots that compose the sprite snapshot. Default value: the height of the original normal snapshot. Unit: pixels. |
Padding |
String |
Yes |
The padding of the original snapshots that compose the sprite snapshot. Unit: pixels. |
Margin |
String |
Yes |
The margin of the original snapshots that compose the sprite snapshot. Unit: pixels. |
Color |
String |
Yes |
The background color of the sprite snapshot. For more information, see Color settings. |
Columns |
String |
Yes |
The number of columns for the original snapshots that compose the sprite snapshot. Valid values: [1,10000]. |
Lines |
String |
Yes |
The number of lines for the original snapshots that compose the sprite snapshot. Valid values: [1,10000]. |
KeepCellPic |
String |
Yes |
Indicates whether to keep the original snapshots that compose the sprite snapshot. Valid values: keep and delete. |
Note: Currently, RGB values are not configurable for the Color parameter.
Fontname
Font |
Description |
SimSun |
The Song typeface. |
WenQuanYi Zen Hei |
The WenQuanYi Zen Hei typeface. |
WenQuanYi Zen Hei Mono |
The WenQuanYi Zen Hei Mono typeface. |
WenQuanYi Zen Hei Sharp |
The WenQuanYi Zen Hei Sharp typeface. |
Yuanti SC |
The regular Round sans typeface for simplified Chinese. |