PallyCon Distributor Watermarking Guide

Overview

PallyCon Distributor Watermarking is a watermarking solution to track the illegally leaked content when a video content is distributed through multiple channels.

PallyCon Distributor Watermarking inserts the channel information to the original video in the form of an invisible watermark, and can detect the watermark information from the leaked video as well as a single video frame captured using any device such as a mobile camera. It also provides an option to insert an additional Visible Watermark.

There is a CLI (Command Line Interface) tool used for the watermark embedding in PallyCon DWM as follows.

  • DWM PreEmbedder: Used to embed the watermark for the distribution channel into Mezzanine or MP4 format files.

It can be easily integrated for secure content distribution in pre-release workflows.

This document is based on DWM PreEmbedder version 3.4.0.

Tutorial Video

This video is a tutorial for applying PallyCon Distributor Watermarking to contents.

DWM Workflow

PallyCon DWM application workflow is as shown below.

PallyCon DWM Workflow
PallyCon DWM Workflow
  1. Input the original video along with the information of the distribution channels into DWM PreEmbedder.
  2. PallyCon DWM server issues a unique DWM ID for each channel through API integration with the DWM PreEmbedder.
  3. DWM PreEmbedder creates videos with unique watermarks as many as the number of channels to be distributed.
  4. Deliver the corresponding DWM video to each distribution channel.
  5. In the event of a content leak, post the content on downloadable link and register it on PallyCon Console for detection service.
  6. PallyCon service extracts the watermark in the leaked copy and delivers the channel information (Distributor ID) to the customer.

Supported Specifications

PallyCon DWM supports the below specifications.

Item Specification Remarks
Content Type Supports video contents only
Format and codec MP4(H.264, H.265, VP9), MOV(ProRes, XDCAM), MXF(XDCAM)
Supported Resolution Up to 4K/UHD resolution
Dynamic Range SDR (Standard Dynamic Range), HDR (High Dynamic Range) supported
Number of DWM ID Depending on PallyCon DWM service plan
Minimum Video Length Need at least 30 seconds of recorded video to detect watermark Cannot support source video shorter than 30 seconds
Video Quality for Detection Need 480p 1Mbps or higher video quality for detection. 720p video is recommended.
Single Frame Detection If there is only single frame captured of watermarked content then original frame required for detection Non-blind detection technique

Registering DWM recipients

For DWM embedding and detection, you firstly need to register recipients who will receive watermarked content. The number of recipient vary depending on the PallyCon DWM service plan. You can register up to 1,000 recipients in the Startup plan, and more than 1,000 recipients in higher plans. A serial number for each recipient is given as a DWM ID in the order of registration.

To register DWM recipients, select the DWM recipient item in the Distributor Watermarking menu of PallyCon Console. You can register a recipient by entering the name and description on the screen after clicking the Register button. (Click the + button when registering multiple items)

When inserting a watermark through DWM PreEmbedder, you may enter the name of the recipient in the job information, then the recipient’s ID (serial number) is inserted as watermark data in the output video.

DWM Embedding

PallyCon DWM PreEmbedder is a Linux CLI (Command Line Interface) based DWM embedding tool. It receives the original video and DWM ID information and outputs the DWM video with the corresponding ID.

When using the DWM PreEmbedder executable file alone, the customer must directly manage the DWM ID and distribution channel information without the use of PallyCon server. For server integration, DWM embedding should be performed through a Python script distributed along with the core executable file.

DWM PreEmbedder Modules

You can request PallyCon DWM PreEmbedder after subscribing to PallyCon Distributor Watermarking service, and is composed as follows:

  • DwmEmbedder: It is an executable file which is a core module executed by the Python script below. It inserts a unique watermark (DWM ID) in the original video for each distribution target channel. Please don’t directly execute this file for watermark embedding as it would lead to detection failure.

  • DwmPreEmbedder.py: This is a Python script in charge of communication between DwmEmbedder and the PallyCon server. DWM embedding should be done only through this script and not the above core module.

  • dwm_info.json: This is a file to input embedding job information such as the original video and output file to insert the DWM ID, and information of recipients.

  • Library files: In the lib folder, there are various libraries used by the DWM Embedder.

  • demokey.dat: This is a demo version key file used for DWM embedding in a trial account. In addition to the invisible watermark (DWM ID), a Visible Watermark (‘PALLYCON DEMO’) will be added in the video preprocessed with the demo key.

After subscribing a DWM plan including the use of DWM PreEmbedder, you may use a commercial version key file(dwmkey.dat) which can be requested via Helpdesk.

Required Environments

You need the following environment to run the DWM PreEmbedder.

Hardware

Software

  • Ubuntu server 18.04, 20.04 or CentOS 7
  • Intel IPP (Integrated Performance Primitives) 2018: Included in the distribution.
  • NVIDIA CUDA Toolkit 11.1 or later (NVIDIA hardware acceleration)
  • Dependency libraries

Installation Guide

NVIDIA CUDA Toolkit 11.1

Pallycon CLI Preprocessor supports NVIDIA H/W encoding/decoding. You can check supported GPUs and codecs here.

It requires CUDA Toolkit 11.1 or above. You can also install the latest version if there are no compatibility issues with your other programs. If you need to install other CUDA Toolkit version, please refer latest download or archive.

  • Installing on Ubuntu 18.04 / 20.04

    $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID|tr -d '.')
    $ wget https://developer.download.nvidia.com/compute/cuda/repos/${distribution}/x86_64/cuda-${distribution}.pin
    $ sudo mv cuda-${distribution}.pin /etc/apt/preferences.d/cuda-repository-pin-600
    $ wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda-repo-${distribution}-11-1-local_11.1.1-455.32.00-1_amd64.deb
    $ sudo dpkg -i cuda-repo-${distribution}-11-1-local_11.1.1-455.32.00-1_amd64.deb
    $ sudo apt-key add /var/cuda-repo-${distribution}-11-1-local/7fa2af80.pub
    $ sudo apt-get update
    $ sudo apt-get -y install cuda
    $ rm cuda-repo-${distribution}-11-1-local_11.1.1-455.32.00-1_amd64.deb
    $ sudo reboot
    
  • Installing on CentOS 7

    $ wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda-repo-rhel7-11-1-local-11.1.1_455.32.00-1.x86_64.rpm
    $ sudo rpm -i cuda-repo-rhel7-11-1-local-11.1.1_455.32.00-1.x86_64.rpm
    $ sudo yum clean all
    $ sudo yum -y install nvidia-driver-latest-dkms cuda
    $ sudo yum -y install cuda-drivers
    $ rm cuda-repo-rhel7-11-1-local-11.1.1_455.32.00-1.x86_64.rpm
    $ sudo reboot
    
  • Installing on AWS Linux2

    • Please refer to this link
  • Verification

    $ nvidia-smi
    
  • References

Install Dependencies

  • Ubuntu 18.04

    $ sudo apt update
    $ sudo apt install -y \
          libva-drm2 \
          libvdpau1 \
          libmediainfo0v5 \
          libpng16-16
    $ sudo apt install -y python3 python3-pip
    $ python3 -m pip install requests
    
  • Ubuntu 20.04

    $ sudo apt update
    $ sudo apt install -y \
          libnuma1 \
          libva-drm2 \
          libvdpau1 \
          libmediainfo0v5 \
          libpng16-16
    $ sudo apt install -y python3 python3-pip
    $ python3 -m pip install requests
    
  • CentOS 7

    $ sudo yum update
    $ sudo yum install -y \
          openssl-devel \
          libpng-devel \
          libmediainfo-devel
    $ sudo yum install -y python3 python3-pip
    $ python3 -m pip install requests
    

DWM PreEmbedder Guide

After unpacking the DWM PreEmbedder distribution in the execution environment prepared through the above installation process, check if there are related files (core executable, Python script, dwm_info.json, key file, etc.) in the bin folder. After that, you can insert the DWM ID into the original video by running DWM PreEmbedder with the steps below.

Create credentials file

In order to communicate with PallyCon DWM server, a credential file should be created with Site ID, Site Key, and Access Key information. Save these values as ~/.pallycon/credentials file in the following format.

site_id=YOUR_SITE_ID
site_key=YOUR_SITE_KEY
access_key=YOUR_ACCESS_KEY

The actual values to be entered in the credentials file can be checked on the Distributor Watermarking > DWM Settings screen after logging in to PallyCon Console.

Create job file

Update the dwm_info.json file, which is the DWM job information file, referring to the example and description below.

{
  "account_id": "your_account_id",
  "content_id":"contentid_test",
  "input": "input.mp4",
  "output": "output.mp4",
  "visible_watermark": {
    "type": "none",
    "image": {
      "filename": "watermark.png"
    },
    "alpha": 0.3,
    "position": [
      { "x": 200, "y": 100},
      { "x": 300, "y": 200}
    ],
    "timing": {
      "interval": "00:05:00",
      "disappear": "00:01:00"
    }
  },
  "recipients": [
      "recipient 1",
      "recipient 2",
      "recipient 3"
  ]
}
  • account_id: Your PallyCon Account ID shown on the console.
  • content_id: Unique ID for the original contents.
  • input: The source file name to embed the DWM ID.
  • output: The target file name to save the DWM-embedded result file.
    • Distribution information (recipient name, DWM ID) is appended after the file name.
  • visible_watermark: “visible” watermark to the output file. (optional)
    • In addition to the invisible DWM ID information, an image watermark can be displayed on the video.
    • You may omit this keyword and its subitems if you don’t want to add Visible Watermark.
    • For detailed options that can be entered, please refer to the separate description below.
  • recipients: list of recipients.
    • Enter the name of recipient who will receive the DWM applied video.
    • Only recipient names registered in PallyCon Console in advance can be entered.

The DWM job details mentioned above are sent to the DWM server API using a Python script. Consequently, the server returns the DWM IDs, which are then incorporated into the output video as an invisible watermark through the core module.

Run DWM PreEmbedder Python script

During the DWM trial, the demo key file (demokey.dat) included with the distribution is used instead of the commercial version key file. In this case, run it by adding the --demo parameter along with the dwm_info.json file name as follows.

$ python3 DwmPreEmbedder.py dwm_info.json --demo

After subscribing to the DWM commercial plan, request the commercial key file (dwmkey.dat) via HelpDesk and copy it to the bin directory, that is, to the same location as DwmPreEmbedder.py. The commercial version runs without the --demo parameter as follows:

$ python3 DwmPreEmbedder.py dwm_info.json

Visible Watermark configuration (optional)

By default, DWM PreEmbedder invisibly embeds a unique DWM ID for each distribution channel into the video. If you want to add a Visible Watermark to the video, you can set the following options in the visible_watermark item of the dwm_info.json file. A single visible watermark can be integrated. You are limited to using just one image file, and only one watermark can be presented simultaneously.

Key Type Mandatory Description Example
type String Y Type of Visible Watermark. “image” to embed image watermark as follow settings, “none” to do not embed any Visible Watermark. “type”: “image”
image String Y Options for image type watermark. Not used for text type watermark.
filename String Y File path of watermark image. “image_file”: “~/watermark.png”
alpha Float N Opacity of Visible Watermark. It allows 1.0 (opaque) ~ 0.01 (transparent). (default: 1) “alpha”: 0.5
position Object array N Options for watermark positioning. If multiple values are set, the values cycle according to the interval.
x, y Integer N X, Y position of the watermark (default: 0,0) [{“x”: 200, “y”: 100}]
timing Object N Options for showing/hiding watermark periodically (watermark interval)
interval String N Period to display a watermark in the format of ‘HH:MM:SS’ (default: unlimited, no repetition) When it is “00:05:00”, it is displayed every 5 minutes and then disappears after the value of disappear.
disappear String N Time until disappearance after displayed in the format of ‘HH:MM:SS’ When it is “00:01:00”, the watermark disappears after 1 minute after every interval.

The image size is up to 5% of the screen resolution. If the image size exceeds 5% of the screen resolution, it will not be automatically resized and embedding will fail. If the video resolution is 1920x1080 px, 300x300 px (4.34%) and 500x200 px (4.82%) images can be embedded, but 400x300 px (5.79%) and 1000x110 px (5.3%) images cannot be embedded.

The image must be fully positioned within the screen without any portion being cut off. If any part of the image is truncated due to the position setting, it will be automatically adjusted to fit inside the screen boundaries.

For instance, if you configure “interval”: “00:05:00”, “disappear”: “00:01:00”, the watermark will appear and disappear in a cyclic pattern every 5 minutes. This means it will display for 1 minute and then remain hidden for 4 minutes.

If “disappear” is set without “interval”, the watermark will vanish after a single display and won’t reappear. Essentially, it can be shown only once for a specified duration. Additionally, the Visible Watermark cannot simultaneously appear in two locations. Instead, a new location is determined by the “interval” before the watermark vanishes as per the “disappear” setting, causing the existing watermark to disappear. In such cases, the value of “disappear” is disregarded, even if set to 0.

Due to the restriction of Apple ProRes codec, the Visible Watermark cannot be applied to ProRes video files as of now. Please request via Helpdesk if you need the feature.

DWM Embedding Job History

You can review the DWM embedding information transmitted to the server in the PallyCon console.

In the Distributor Watermarking > DWM packaging history screen, you can inquire the recipient information entered in the dwm_info.json.

DWM PreEmbedder Error Code

Error Code Status
0 Success
1 Unknown error
2 Out of memory
10 Stopped by user
30 Failed to validate Access Key
31 Key file does not exist
40 Input file name error
41 Input file does not exist
42 Output file name error
43 Output directory does not exist
50 Failed to open video input stream
51 Failed to open video output stream
52 Failed to write output track
53 Failed to write video output track
54 Input file does not have any video track
100 Setting error
150 Failed to initialize DWM embedder
151 Invalid symbol in the input
200 Failed to find encoder library
201 Failed to find decoder library
210 Failed to init decoder device
220 Unsupported codec
230 No Visual Watermark settings when it is enabled
231 Failed to set the Visual Watermark
232 Visible Watermark image file does not exist
233 Visible Watermark image file is invalid
234 Visible Watermark image area is too small or large
301 Config file format is invalid
302 Credentials file does not exist
303 Credentials file format is invalid
304 Data in credentials files are invalid
305 DWM job file does not exist
306 DWM job file format is invalid
307 Account ID does not set
308 Content ID does not set
309 Input file name does not set
310 Output file name does not set
311 Recipients list does not set
312 Input file does not exist
313 Input and/or output file names are invalid
314 Extensions of input and output files are different
315 Output file path is invalid
316 Core executable (DwmEmbedder) does not exist
321 Server API does not initialize
322 Server API parameters are invalid
323 Invalid Server API request format
324 Invalid Server API response format
325 Server does not respond
326 Server responds error
331 DWM PreEmbedder internal error
401 Unknown error

DWM Detection

If a video with DWM applied is leaked and distributed illegally, you can request the PallyCon service to detect a watermark on the video that is suspected of being leaked. To request watermark detection, register the title and download link of the video on the DWM detection request page of the PallyCon Console.

DWM detection analyzes each frame of the video to detect the original watermark pattern and decrypts the data with the secret key used at the time of insertion. If a DWM ID is found through the detection process, we find the distribution channel(recipient) information in our database and report it as the detection result.

If a single frame of the DWM applied video is illegally distributed even that can be detected using our detection service but for that the original non-watermarked video is required as it is based on non-blind technology.

For DWM detection, a continuous recorded video of at least 30 seconds or longer is required. PallyCon DWM solution is robust against various attacks including resizing, but the actual detection rate of the watermark may vary depending on the video quality (resolution, bitrate, shake, etc.) used for detection. The minimum specification required for detection is 480p 1Mbps or higher, and most of the video over 720p can be detected.
sequenceDiagram
    participant A as Service site
    participant B as PallyCon service
    A ->> B: Suspicious content
    Note right of B: Detect watermark
    B -->> B: Analyze video frames
    opt DWM ID detected
    Note right of B: DWM recipients DB
    B -->> B: Find the recipient data
    end
    B ->> A: Report detection result

Please contact us for detailed information on watermark detection such as monitoring service.

Contact Us

Previous
Next