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. Prerequisite for Hybrik Preprocessor

Once signup is completed, please request for wm key file and access key through Help Desk.

2. How to 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 during the trial phase. After subscribing to the FWM commercial plan, you must use the values issued for your PallyCon account at step 1 instead.

3. How to setup transcoding and FWM preprocessor plugin

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: 2
  • target/video/codec: "h264" or "h265"
  • target/video/use_scene_detection: false
  • target/video/use_closed_gop: true

The following FPS are supported according to the support specifications, and target/video/idr_interval/frames must be specified for each FPS as follows:

FPS target/video/idr_interval/frames
23.976, 24 48
25 50
29.97, 30 60
47.952, 48 96
50 100
59.94, 60 120

Even when using the Segmented Rendering, "duration_sec" must be specified as multiple of 2 seconds or 2.002 seconds depending on the IDR length.

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, set the FWM preprocessor plugin and the properties below to preprocess 0 or 1 symbol.

  • target/video/filters/kind: "plugin_docker"
  • target/video/filters/payload/docker_image/image_urn: "public.ecr.aws/pallycon/wm_plugin_pub:latest"
  • 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’s an example illustrating the application of the above-described FWM preprocessing settings.

{
  ...,
  "payload": {
    "elements": [
      ...,
      {
        "uid": "transcode_video_wm0_task",
        "kind": "transcode",
        "payload": {
          ...,
          "targets": [
            {
              ...,
              "container": {
                "kind": "fmp4",
                "segment_duration_sec": "2"
              },
              "video": {
                ...,
                "use_scene_detection": false,
                "use_closed_gop": true,
                "frame_rate": "30000/1001",
                "idr_interval": {
                  "frames": 60
                },
                "filters": [
                  {
                    "kind": "plugin_docker",
                    "payload": {
                      "docker_image": {
                        "image_urn": "public.ecr.aws/pallycon/wm_plugin_pub:latest",
                        "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_wm1_task",
        "kind": "transcode",
        "payload": {
          ...,
          "targets": [
            {
              ...,
              "container": {
                "kind": "fmp4",
                "segment_duration_sec": "2"
              },
              "video": {
                ...,
                "use_scene_detection": false,
                "use_closed_gop": true,
                "frame_rate": "30000/1001",
                "idr_interval": {
                  "frames": 60
                },
                "filters": [
                  {
                    "kind": "plugin_docker",
                    "payload": {
                      "docker_image": {
                        "image_urn": "public.ecr.aws/pallycon/wm_plugin_pub:latest",
                        "registry": {
                          "kind": "ecr"
                        }
                      },
                      "config": {
                        "wm_key_file_base64": "{{wm_key_file_base64}}",
                        "wm_access_key": "{{wm_access_key}}",
                        "wm_fwm_symbol": 1
                      }
                    }
                  }
                ]
              },
              ...
            }
          ]
        }
      }
    ],
    ...
  }
}

4. 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. Please be careful not to overwrite the A version manifest with B one. We recommend that the location and name of the B version manifest is different from the A version and delete B version manifest file after packaging.
  • Since the user will play the A version manifest, we only need to include audio in the A version.
  • segmentation_mode must be segmented_mp4 or segmented_ts.

5. 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_wm0_task"
            },
            {
              "element": "transcode_video_wm1_task"
            },
            {
              "element": "transcode_audio_task"
            }
          ]
        }
      },
      {
        "from": [
          {
            "element": "transcode_video_wm0_task"
          },
          {
            "element": "transcode_audio_task"
          }
        ],
        "to": {
          "success": [
            {
              "element": "dash_seg_mp4_wm0"
            },
            {
              "element": "hls_seg_ts_wm0"
            }
          ]
        }
      },
      {
        "from": [
          {
            "element": "transcode_video_wm1_task"
          }
        ],
        "to": {
          "success": [
            {
              "element": "dash_seg_mp4_wm1"
            },
            {
              "element": "hls_seg_ts_wm1"
            }
          ]
        }
      }
    ]
  }
}

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