All Products
Search
Document Center

ApsaraVideo VOD:AddWatermark

Last Updated:Jun 10, 2026

Membuat Template watermark image atau teks. ApsaraVideo VOD memungkinkan Anda membuat Template watermark untuk menggunakan kembali konfigurasi parameter seperti posisi, ukuran, font, dan warna watermark. Setiap Template watermark diberi ID unik. Hal ini menyederhanakan pemrosesan tugas watermark.

Deskripsi operasi

  • You can call this operation to create an Image watermark template or a Text watermark template. You can use static images in the PNG format or dynamic images in the GIF, APNG, and MOV formats as image watermarks.

  • After you call this operation to create a watermark template, you must call the AddTranscodeTemplateGroup or UpdateTranscodeTemplateGroup operation to associate the watermark template with a transcoding template group. This way, you can add watermarks to videos during transcoding.

  • For more information, see Video watermarks.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

vod:AddWatermark

create

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

Type

string

Yes

Tipe Template watermark. Nilai valid:

  • Image (default): Template watermark image

  • Text: Template watermark teks.

Text

Name

string

Yes

Nama Template watermark.

  • Hanya huruf dan angka yang didukung.

  • Nama tidak boleh melebihi 128 byte.

  • Nilai harus dikodekan dalam format UTF-8.

watermark

WatermarkConfig

string

Yes

Informasi konfigurasi watermark seperti posisi tampilan dan efek khusus. Nilai harus berupa string dalam format JSON. Parameter konfigurasi untuk watermark image dan teks berbeda. Untuk informasi selengkapnya tentang struktur parameter, lihat WatermarkConfig.

{"Width":"55","Height":"55","Dx":"9","Dy":"9","ReferPos":"BottonLeft"}

FileUrl

string

No

URL file watermark. URL harus berupa URL Object Storage Service (OSS) dalam format yang tidak boleh berisi informasi yang digunakan untuk Penandatanganan URL.

Catatan
  • Parameter ini diperlukan jika Anda mengatur Type ke Image.

  • Anda dapat memperoleh URL dari parameter FileURL di tanggapan operasi CreateUploadAttachedMedia yang Anda panggil untuk mengunggah image watermark ke ApsaraVideo VOD.

http://outin-326268*****63e1403e7.oss-cn-shanghai.aliyuncs.com/image/cover/C99345*****E7FDEC-6-2.png

AppId

string

No

ID aplikasi dalam format. Nilai default: app-1000000. Jika Anda telah mengaktifkan layanan multi-aplikasi, tentukan ID aplikasi untuk menambahkan Template watermark di aplikasi yang ditentukan. Untuk informasi selengkapnya, lihat Ikhtisar.

app-****

Elemen respons

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

25818875-5F78-4A*****F6-D7393642CA58

WatermarkInfo

object

The information about the watermark template.

CreationTime

string

The time when the watermark template was created. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2018-11-07T09:05:52Z

Type

string

The type of the watermark template.

  • Image: image watermark template

  • Text: text watermark template

Text

IsDefault

string

Indicates whether the watermark template is the default one. Valid values:

  • Default

  • NotDefault

NotDefault

FileUrl

string

The URL of the watermark file. The URL is an Object Storage Service (OSS) URL or an Alibaba Cloud CDN URL.

Catatan

This parameter is returned only for image watermark templates.

https://outin-3262*****9f4b3e7.oss-cn-shanghai.aliyuncs.com/image/cover/E6C3448CC8B715E6F8A72EC6B-6-2.png?Expires=1541600583&OSSAccessKeyId=****&Signature=gmf1eYMoDVg%2BHQCb4UGozBW****

WatermarkConfig

string

The configuration information of the watermark such as the display position and special effects. The value is a JSON string. The configuration parameters for image and text watermarks are different. For more information about the parameter structure, see WatermarkConfig.

{"FontColor": "Blue","FontSize": 80, "Content": "watermark test" }

Name

string

The name of the watermark template.

text watermark test

WatermarkId

string

The ID of the watermark template.

9bcc8bfadb84*****109a2671d0df97

Contoh

Respons sukses

JSONformat

{
  "RequestId": "25818875-5F78-4A*****F6-D7393642CA58",
  "WatermarkInfo": {
    "CreationTime": "2018-11-07T09:05:52Z",
    "Type": "Text",
    "IsDefault": "NotDefault",
    "FileUrl": "https://outin-3262*****9f4b3e7.oss-cn-shanghai.aliyuncs.com/image/cover/E6C3448CC8B715E6F8A72EC6B-6-2.png?Expires=1541600583&OSSAccessKeyId=****&Signature=gmf1eYMoDVg%2BHQCb4UGozBW****",
    "WatermarkConfig": "{\"FontColor\": \"Blue\",\"FontSize\": 80, \"Content\": \"watermark test\" }",
    "Name": " text watermark test",
    "WatermarkId": "9bcc8bfadb84*****109a2671d0df97"
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.