Image watermark template parameters

更新时间:
复制 MD 格式

This topic describes a sample Intelligent Media Services (IMS) image watermark template and the template parameters.

Parameter

Data type

Required

Description

Example

Width

number

Yes

The width of the watermark in the output video. The value can be an integer or a decimal number.

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

    • Valid values: [8,4096].

    • Unit: pixels.

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

    • Valid values: (0,1).

    • Four decimal places are supported, such as 0.9999. Extra decimal places are discarded.

32

Height

number

Yes

The height of the watermark image in the output video. The value can be an integer or a decimal number.

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

    • Valid values: [8,4096].

    • Unit: pixels.

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

    • Valid values: (0,1).

    • Four decimal places are supported, such as 0.9999. Extra decimal places are discarded.

32

Dx

number

No

The horizontal offset of the watermark relative to the output video. Default value: 0. The value can be an integer or a decimal number.

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

    • Valid values: [8,4096].

    • Unit: pixels.

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

    • Valid values: (0,1).

    • Four decimal places are supported, such as 0.9999. Extra decimal places are discarded.

10

Dy

number

No

The vertical offset of the watermark relative to the output video. Default value: 0. The value can be an integer or a decimal number.

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

    • Valid values: [8,4096].

    • Unit: pixels.

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

    • Valid values: (0,1).

    • Four decimal places are supported, such as 0.9999. Extra decimal places are discarded.

10

ReferPos

string

Yes

The position of the watermark. Default value: TopRight. Valid values:

  • TopRight

  • TopLeft

  • BottomRight

  • BottomLeft

TopLeft

Timeline

JSON

No

The time configurations for the animated watermark display. For more information, see Timeline.

{"Start":"00:00:05","Duration":"ToEND"}

File

JSON

No

The watermark image file. For more information, see File.

{"Type":"OSS","Media":"oss://examplebucket/path/to/image****.png"}

Timeline

Parameter

Data type

Required

Description

Example

Start

string

Yes

The beginning of the time range in which the watermark is displayed.

  • Unit: seconds

  • Valid values: positive numbers

  • Default value: 0

00:00:05

Duration

string

No

The time range in which the watermark is displayed.

  • Valid values: [Value of the Start parameter,ToEND].

  • Default value: ToEND, which indicates the end of the video.

ToEND

File

Parameter

Data type

Required

Description

Example

Type

string

Yes

The type of the media object. Valid values:

  • OSS: Object Storage Service (OSS) objects

  • Media: media assets

OSS

Media

string

Yes

The information about the media object.

  • If the Type parameter is set to OSS, the value of this parameter is a URL. OSS and HTTP protocols are supported.

  • If the Type parameter is set to Media, the value of this parameter is the ID of a media asset.

oss://examplebucket/path/to/image****.png

Sample template

{
  "Dx": 120,
  "Dy": 130,
  "Height": 30,
  "ReferPos": "BottomLeft",
  "File": {
    "Type": "OSS",
    "Media": "https://sample-bucket.oss-cn-shanghai.aliyuncs.com/sample.gif"
  },
  "Width": 20
}