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.5.2.

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.

The recipient name must be unique and can only contain English letters (uppercase and lowercase), decimal numbers, hyphens (-), underscores (_), and periods (.). No other special characters such as @, #, $, % etc supported. However, the system treats recipient names in a case-insensitive manner. This means that if you register Test, you cannot register variations like TEST or test as separate recipient names. Similarly, when using a DWM ID, regardless of the case used in the request (e.g., test), the system will utilize the DWM ID associated with the originally registered recipient name (e.g., Test).

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 DWM 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 Cause Solution
DWM0000 Success - -
DWM0001 Undefined DwmEmbedder error Undefined DwmEmbedder error occurs. Contact us with displayed message.
DWM0002 Not enough memory Insufficient system memory. Terminate unnecessary processes and retry again.
DWM0010 User canceled Interrupted by user such ac Ctrl + C. -
DWM0030 Access key mismatched Access key does not match key file. Set valid access key for key file.
DWM0031 No key file The key file does not exist. Set valid key file name.
DWM0043 Invalid output path The output path is not writable. Set writable output file path.
DWM0054 Invalid input file The input file has no video track. Retry with input file which contains video track.
DWM0200 Encoder not found There is no valid video encoder. Reinstall valid video encoder.
DWM0201 Decoder not found There is no valid video decoder. Reinstall valid video decoder.
DWM0220 Restricted codec The video codec is restricted or not supported. Check supported codecs.
DWM0301 Invalid config file The config file is not valid JSON format. Check config file.
DWM0302 No credential file The credential file does not exist. Set valid credential file name.
DWM0303 Invalid credential file The credential file does not contain some mandatory data. Check credential file.
DWM0304 Incorrect credential data length The length of some data in the credential file is incorrect. Check credential data and length in file.
DWM0305 No job file The job file does not exist. Set valid job file name.
DWM0306 Invalid job file The job file is not valid JSON format. Check job file.
DWM0307 Account id not set The account id is mandatory but not set. Set account id by job file.
DWM0308 Content id not set The content id is mandatory but not set. Set content id by job file or command line.
DWM0309 Input file not set The input file is mandatory but not set. Set input filename by job file or command line.
DWM0310 Output file not set The output file is mandatory but not set. Set output filename by job file or command line.
DWM0311 Recipients not set The recipients are mandatory but not set. Set recipients by job file.
DWM0312 No input file The input file does not exist. Set valid input filename.
DWM0313 Invalid input/output type The input and output must be filenames with extension. Set valid input/output filenames with extension.
DWM0314 Mismatched extensions The extensions of the input and output files do not match. Match input/output file extensions (container).
DWM0315 Invalid output path The output path is invalid. Set valid and writable output path.
DWM0316 Invalid visible watermark The visible watermark syntax is invalid. Set valid visible watermark syntax.
DWM0317 No visible watermark file The visible watermark input file does not exist. Set valid visible watermark input filename.
DWM0321 Invalid DWM-API Server state Some DWM-API Server is called while it is not ready. If you have changed the script, restore it.
DWM0322 Invalid request parameter Some DWM-API Server parameter is invalid. If you have changed the script, restore it.
DWM0323 DWM-API Server failed DWM-API Server does not respond correctly. Contact us and retry later.
DWM0324 Invalid response format DWM-API Server response is invalid JSON or some mandatory data is absent. Contact us with error code and response message.
DWM0325 DWM-API Server error DWM-API Server responds an error code. Contact us with error code and response message.
DWM0326 Wrong content id in response DWM-API Server response contains wrong content id. Contact us with error code and response message.
DWM0331 No DwmEmbedder executable The DwmEmbedder executable does not found. Re-extract software package file.
DWM0332 Invalid internal status Invalid internal status. Contact us with displayed message. If you have changed the script, restore it.
DWM0401 Undefined DwmPreEmbedder error Undefined DwmPreEmbedder error occurs. Contact us with displayed message.
APIxxxx DWM-API Server error DWM-API Server responds an error code. Refer DWM-API Server guide at online docs.

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