FWM Hybrik Preprocessor Guide

Overview

PallyCon FWM Hybrik preprocessor is a module that can perform forensic watermarking preprocessing during video transcoding through Dolby Hybrik service.

A/B version (0/1 version) mp4 video can be created through Hybrik encoder with preprocessor module applied, and each file can be packaged as DASH or HLS. If both forensic watermark and DRM are applied, please also refer to Hybrik DRM Integration Guide for DRM packaging through CPIX API.

sequenceDiagram
    participant A as Content service provider<br>(Customer)
    participant B as Customer's S3 storage
    participant C as Customer's EC2 instance<br>(with Hybrik engine)
    participant D as Dolby Hybrik <br>console or API 
    participant E as PallyCon service
    A ->> D: Register AWS credential (allow S3, EC2 access)
    A ->> B: Upload source video
    A ->> D: Register transcoding/packaging job
    D ->> C: Create instance with Hybrik 
    B ->> C: Copy source video
    C -->> C: Encoding/transcoding 
    Note right of C: A/B preprocessing<br>(FWM preprocessor)
    C -->> C: DASH/HLS packaging
    opt Apply multi-DRM 
    C ->> E: Request encryption key (CPIX API)
    E ->> C: Response encryption key
    C -->> C: Encrypt content
    end
    C ->> B: Result of preprocessing and packaging
    Note right of B: DASH / HLS content<br>(A/B versions)

For a detailed information and guide to the Dolby Hybrik media processing service, please refer to the links below.

Download sample

You can download an example JSON file for the full setup described in How to integrate section below. (Right-click and save as)

Full example JSON file

How to integrate

1. Request Hybrik preprocessor module

After sign up to PallyCon service, request Docker image information for Hybrik preprocessing through Help Desk.

2. Set up preprocessor docker image connection

Apply the Docker image URL of the Hybrik preprocessor module obtained in step 1 to the Hybrik transcoding job.

For details on how to use Docker images in Hybrik, please refer to the Hybrik Docker Tutorial page. The following is an example of setting global variables when using Amazon Elastic Container Registry (Amazon ECR).

  • Amazon ECR
    {
      "definitions": {
        ...
        "awsecr_image_urn": "<your_aws_iam_id>.dkr.ecr.<your_region>.amazonaws.com/<your_image_name:tag>",
        ...
      },
      ...
    }
    

3. Set FWM preprocessor authentication information

Set the authentication information of the FWM preprocessor as follows:

{
  "definitions": {
    ...
    "wm_key_file_base64": "yxFNjptzCUNHE5d/gJ5g+fWZHi0XUFuZxHuFD0ycQCZvuVpQUMZO79OqVat5VMp9gZIRTrC63Lf3otykHBL9sVyEDr3jAqDnEBXD9JPiNne9bFf1k1hH1hUiIrj1YeYRtfNVdDstmC2JMBzApHdGjGPSRBE=",
    "wm_access_key": "FOR_INKA_FORENSIC_WATERMARK_TEST",
    ...
  },
  ...
}
The above is an example of demo mode for a trial. After subscribing to the FWM commercial plan, you must use the values issued for your PallyCon account instead.

4. Connect docker image and set up FWM preprocessor

To use the FWM preprocessor in Hybrik, you need to specify the below image properties in your transcoding job as follows:

  • target/container/kind: "fmp4"
  • target/container/segment_duration_sec: 1
  • target/video/use_scene_detection: false
  • target/video/use_closed_gop: true
  • target/video/idr_interval/frames: 60

Since it is necessary to generate A/B version files with watermark symbols corresponding to 0 and 1, transcoding must be performed twice for the same original video. To be compatible with Akamai CDN, the B version (symbol 1) file name must be the same as A version (symbol 0) with b. appended before the file name, such as b.<A version file name>. Please refer to the unlabeled A variant part of Akamai guide.

The following is an example when the A version file name is "{source_basename}{default_extension}". The file name can be changed to a value different from the example, but you also need to change the B version file name for the same and add b. at the beginning.

  • A version (symbol 0) file name - target/file_pattern: "{source_basename}{default_extension}"
  • B version (symbol 1) file name - target/file_pattern: "b.{source_basename}{default_extension}"

Also, connect the FWM preprocessor Docker image and specify the properties below to insert 0 or 1 symbol.

  • target/video/filters/kind: "plugin_docker"
  • target/video/filters/payload/docker_image/image_urn: "{{awsecr_image_urn}}"
  • target/video/filters/payload/docker_image/registry/kind: "ecr"
  • target/video/filters/payload/config/wm_key_file_base64: "{{wm_key_file_base64}}"
  • target/video/filters/payload/config/wm_access_key: "{{wm_access_key}}"
  • target/video/filters/payload/config/wm_fwm_symbol: 0 or 1

Here is an example of Docker image connection and FWM preprocessor setup when using Amazon ECR.

  • Amazon ECR
    {
      ...,
      "payload": {
        "elements": [
          ...,
          {
            "uid": "transcode_video_0_task",
            "kind": "transcode",
            "payload": {
              ...,
              "targets": [
                {
                  ...,
                  "container": {
                    "kind": "fmp4",
                    "segment_duration_sec": "1"
                  },
                  "video": {
                    ...,
                    "use_scene_detection": false,
                    "use_closed_gop": true,
                    "idr_interval": {
                      "frames": 60
                    },
                    "filters": [
                      {
                        "kind": "plugin_docker",
                        "payload": {
                          "docker_image": {
                            "image_urn": "{{awsecr_image_urn}}",
                            "registry": {
                              "kind": "ecr"
                            }
                          },
                          "config": {
                            "wm_key_file_base64": "{{wm_key_file_base64}}",
                            "wm_access_key": "{{wm_access_key}}",
                            "wm_fwm_symbol": 0
                          }
                        }
                      }
                    ]
                  },
                  ...
                }
              ]
            }
          },
          {
            "uid": "transcode_video_1_task",
            "kind": "transcode",
            "payload": {
              ...,
              "targets": [
                {
                  ...,
                  "container": {
                    "kind": "fmp4",
                    "segment_duration_sec": "1"
                  },
                  "video": {
                    ...,
                    "use_scene_detection": false,
                    "use_closed_gop": true,
                    "idr_interval": {
                      "frames": 60
                    },
                    "filters": [
                      {
                        "kind": "plugin_docker",
                        "payload": {
                          "docker_image": {
                            "image_urn": "{{awsecr_image_urn}}",
                            "registry": {
                              "kind": "ecr"
                            }
                          },
                          "config": {
                            "wm_key_file_base64": "{{wm_key_file_base64}}",
                            "wm_access_key": "{{wm_access_key}}",
                            "wm_fwm_symbol": 1
                          }
                        }
                      }
                    ]
                  },
                  ...
                }
              ]
            }
          }
        ],
        ...
      }
    }
    

When using Docker Hub, only the Docker image connection related part is changed as follows.

  • Docker Hub
    {
                          ...,
                          "docker_image": {
                            "image_urn": "{{dockerhub_image_urn}}",
                            "registry": {
                              "kind": "dockerhub",
                              "access": {
                                "username": "{{dockerhub_id}}",
                                "password": "{{dockerhub_passwd}}"
                              }
                            }
                          },
                          ...
    }
    

5. Configure DASH/HLS packaging

Package the generated A/B version mp4 files as DASH and HLS respectively. Please refer to the HLS and DASH Packaging Tutorial from Hybrik for more details.

  • A/B version media segments must be located in the same directory.
  • When users play media, they must play the A version manifest, not the B version manifest. To do this, we specify that only the location of the version B manifest file is the same as the media segment.
  • segmentation_mode must be segmented_mp4 or segmented_ts.

The following is an example of DASH / HLS packaging setup. (Right-click and save as)

Packaging example JSON file

6. Connect jobs

The transcoding output of A version (0) should be connected with A version DASH/HLS packaging, and the output of B version (1) should be connected with B version packaging, respectively.

Please refer to the connection example below:

{
  {
    ...,
    "connections": [
      {
        "from": [
          {
            "element": "source"
          }
        ],
        "to": {
          "success": [
            {
              "element": "transcode_video_0_task"
            },
            {
              "element": "transcode_video_1_task"
            }
          ]
        }
      },
      {
        "from": [
          {
            "element": "transcode_video_0_task"
          }
        ],
        "to": {
          "success": [
            {
              "element": "dash_seg_mp4_0"
            },
            {
              "element": "hls_seg_ts_0"
            }
          ]
        }
      },
      {
        "from": [
          {
            "element": "transcode_video_1_task"
          }
        ],
        "to": {
          "success": [
            {
              "element": "dash_seg_mp4_1"
            },
            {
              "element": "hls_seg_ts_1"
            }
          ]
        }
      }
    ]
  }
}

An example JSON file of the full setup that combines the above can be downloaded from the following link: (Right-click and save as)

Full example JSON file

7. Start the jobs and check the result

Execute the transcoding and packaging jobs set through the above process using the Hybrik console or API. The output of the operation is available in the S3 bucket that you specified as the output storage.

Next step

A/B(0/1) version of DASH or HLS content created through Hybrik preprocessor can be played by using Session Manager API and CDN integration which enable real-time watermark embedding at playback time. Please refer to the linked guides for details.

Previous