Short Video Watermark

更新时间:
复制 MD 格式

Short video watermarking is primarily used for copyright protection and leak tracing in scenarios such as AIGC-generated short videos and promotional short videos. It delivers high visual quality and strong robustness.

The service currently supports embedding both visible and invisible watermarks into short videos.

  • If you embed a visible watermark, you can directly view the watermark information on the short video to identify the source of the leak.

  • If you embed an invisible watermark, the watermark information is not visible to the naked eye. In this case, use the SASE console to extract the invisible watermark information and identify the source of the leak. The short video used for embedding and extraction must be longer than 1 second (videos over 10 seconds yield the best results).

Most information leaks or copyright disputes involve invisible watermarks.

Workflow

Prerequisites

You have purchased the short video watermark service. For more information, see Digital watermarking billing overview.

Embed the short video watermark SDK on your app server

You have a Linux server based on the x86 architecture. This server will host the short video watermark SDK.

This topic uses an Ubuntu 24.04 64-bit server as an example.

Step 1: Download the short video watermark SDK

  1. Log on to the Secure Access Service Edge console.

  2. In the navigation pane on the left, choose Digital Watermarking > Embedding Service.

  3. On the Embedding Service page, click Download SDK in the Actions column.

    Download the short video watermark package to your local machine. Only Java is currently supported.

    The downloaded SDK package contains the following files:

    watermark-purevideo-short-v1.0.0.jar: The SDK JAR file for watermark integration. Add this file to your Maven repository.

    watermark-purevideo_short_demo: A demo project to help you get started with watermarking.

  4. Click the icon in the AK/SK Information column to copy and save your AccessKey ID and AccessKey secret locally.

Step 2: Integrate the SDK

  1. Add the JAR dependency (Maven).

    1. Add the watermark-purevideo-short-v1.0.0.jar dependency.

      mvn install:install-file  -Dfile=watermark-purevideo-short-v1.0.0.jar  -DgroupId=com.aliyun.security.sase -DartifactId=watermark-purevideo-short -Dversion=v1.0.0  -Dpackaging=jar
    2. Add the following dependency to your pom.xml file.

      <dependency>
        <groupId>com.aliyun.security.sase</groupId>
        <artifactId>watermark-purevideo-short</artifactId>
        <version>v1.0.0</version>
        <scope>compile</scope>
      </dependency>
  2. Call the short video watermark API.

    1. Initialize your AccessKey ID and AccessKey secret.

      /**
       * Initialize AccessKey ID and AccessKey secret.
       * @param appKey Application key
       * @param secret Application secret
       * @param useLocalConfig Use local configuration: 0 for remote configuration (requires internet access), 1 for local configuration
       */
      WaterMarkShortVideoUtils.init(appKey, secret, useLocalConfig);
    2. Add a digital watermark to a short video.

      A new video file is generated after adding the watermark.

      ParamsFile paramsFile = new ParamsFile();
      // Supported short video formats: mp4, mov, avi, ts, f4v, mkv
      paramsFile.setSrcFilePath("123.mp4");
      paramsFile.setDestFilePath("234.mp4");
      // Visible watermark configuration
      paramsFile.setText("Hello123a   bcOK");
      // x and y are pixel offsets from the top-left corner of the video
      paramsFile.setText_x("100");
      paramsFile.setText_y("100");
      // Font file path
      paramsFile.setFontfile("/tmp/AlibabaPuHuiTi-2-45-Light.ttf");
      // Font size
      paramsFile.setFontsize("48");
      // Font color in RGB format
      paramsFile.setFontcolor("0xFF0000");
      // Opacity, range 0 to 1
      paramsFile.setAlpha("0.5");
      // Invisible watermark parameter: a decimal string between 0 and 4294967295
      paramsFile.setWatermarkbitsStr("12345");
      // Embedding frequency: embed one frame every n frames. Default is 10.
      paramsFile.setInterleaveRate("10");
      WaterMarkShortVideoUtils.waterMarkIntoVideoShort(paramsFile);

Extract invisible watermark information

You have obtained a leaked video file containing an embedded invisible watermark.

Step 1: Create an extraction task

  1. Log on to the Secure Access Service Edge console.

  2. In the navigation pane on the left, choose Digital Watermarking > Extraction Service.

  3. On the Extraction Service page, click Create Extraction Task.

  4. In the Create Extraction Service panel, configure the extraction file as follows.

    Configuration item

    Description

    Watermark version

    Select the watermark version you purchased.

    Watermark type

    Select Video Watermark.

    Embedded watermark bit width

    Set the bit width of the watermark information. This must match the bit width used during embedding (default is 32 bits).

    Video type

    Select Short Video.

    Upload file for watermark extraction

    Upload the leaked file as instructed in the interface.

  5. Click OK.

    After successful creation, the task appears on the Extraction Service page.

Step 2: View extraction results

After the watermark task finishes, view the extraction results to obtain the original invisible watermark text.

  1. On the Extraction Service page, click Show in the Extraction Information column.

  2. In the expanded details, you can find the original invisible watermark text (a decimal number).

    The details also show the content type as "Embedded 64-bit uint information" along with the corresponding invisible watermark value.

Trace the leaker

Match the extracted invisible watermark text with your business mapping service or custom mapping table to identify the specific individual responsible for the leak.

For example, if the extracted invisible watermark text is 123456 and your mapping table shows that 123456 corresponds to Zhang San, then the leaker is employee Zhang San.

References