All Products
Search
Document Center

Media processing parameters

Last Updated: Aug 08, 2019

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

  1. {
  2. "CipherText":"ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt",
  3. "DecryptKeyUri":"http://decrypt.demo.com?CipherText=ZjJmZGViNzUtZWY1Mi00Y2RlLTk3MTMt",
  4. "KeyServiceType":"KMS"
  5. }

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

  1. [
  2. {
  3. "TranscodeTemplateId":"9580424e49b28c952a46544e3e8f2268",
  4. "Video":{
  5. "Width":720,
  6. "Height":480,
  7. "Bitrate":"600"
  8. },
  9. "Audio":{
  10. "Bitrate":128
  11. },
  12. "Clip":{
  13. "TimeSpan":{
  14. "Seek":"1"
  15. "Duration":"5"
  16. },
  17. "Rotate":"270",
  18. "TranscodeFileRegular":"{MediaId}/{JobId}/{PlayDefinition}"
  19. }
  20. }
  21. ]

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:
  • auto
  • UTF-8
  • GBK
  • BIG5

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

  1. {
  2. "Watermarks":[
  3. {
  4. "WatermarkId":"watermark1",
  5. "FileUrl":"http://test.bucket.aliyuncs.com/image/replace.png"
  6. },
  7. {
  8. "WatermarkId":"watermark2",
  9. "Content": "Watermark test"
  10. }
  11. ],
  12. "SubtitleSetting":{
  13. "SubtitleList":[
  14. {
  15. "SubtitleUrl":"http://outin-40564284ef051100163e1403e7.oss-cn-shanghai.aliyuncs.com/subtitles/7b850b-724c-4011-b885-dd16cc112.ass",
  16. "CharEncode":"UTF-8"
  17. },
  18. {
  19. "SubtitleUrl":"http://outin-40564284ef0511e0163e1403e7.oss-cn-shanghai.aliyuncs.com/subtitles/7b86db-724c-4011-b885-dd161d1cyy.srt",
  20. "CharEncode":"auto"
  21. }
  22. ]
  23. }
  24. }

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: [数字,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.