Forensic Watermarking for OTT: How A/B Variants Work, and How to Run Them on AWS and Akamai
TL;DR
- A/B watermarking is a delivery mechanism, not a watermarking algorithm. A separate algorithm produces two watermarked copies of every segment, one carrying a 0 and the other a 1. Each session receives its own sequence of copies, and that sequence spells out an identifier.
- Two things follow from that structure. Imperceptibility and robustness depend on the algorithm, and the design is vulnerable to collusion.
- With 2-second segments the stream carries at most 1 bit every 2 seconds, so payload length sets the minimum video length.
- The player does nothing special. A token carries the session’s pattern, and the CDN edge uses it to pick A or B for each segment request. Everyone gets the same manifest.
- The DASH-IF Forensic A/B Watermarking specification, published as ETSI TS 104 002 in 2023, standardizes the token, the pacing metadata, and the edge behavior.
- AWS covers variants with MediaConvert for VOD and MediaLive and MediaPackage for live, and the edge logic runs in CloudFront Functions or Lambda@Edge.
- Akamai offers a Watermarking behavior in Adaptive Media Delivery and an EdgeWorkers module that follows the DASH-IF specification.
The problem: a unique copy for every viewer, at CDN scale
DRM protects a stream until it is decrypted on an authorized device. After that, a pirate can capture the output and restream it. Forensic watermarking does not stop this. As Akamai’s documentation says, it identifies the source of a leak rather than protecting the content. Once a source is identified, the session or account can be blocked.
To trace a leak, each viewer’s copy must differ. The DASH-IF specification describes this as being in opposition to delivery mechanisms that aim to send the same asset to every user. It also describes the older answer: watermark at the last step of the pipeline, on a device such as a set-top box. That leaves the delivery pipeline unaltered, but raises security and interoperability challenges across the phones, tablets, laptops, and TVs used for OTT.
A/B watermarking moves the work into the network instead.
The core idea: two copies, one bit per segment
Adaptive streams are already cut into segments. A/B watermarking generates two pre-watermarked variants of each segment:
- Variant A carries a watermark meaning
0. - Variant B carries a watermark meaning
1.
Each session is assigned a watermark pattern, a series of A/B decisions. If a session’s pattern starts 0 1 1 0, it receives A, B, B, A for the first four segments. The specification leaves the meaning of the pattern to the service: it can identify a device, an account, or a streaming session.
This has direct effects on delivery:
- Storage. Each media file exists in two versions, so origin storage grows.
- Caching. The edge caches the two variants of a segment under different cache keys.
- Manifests. All viewers receive the same manifest, which does not reveal which variant is which.
- Renditions. Each rendition in the bitrate ladder has its own A and B copies.
A leaked copy is read back the same way. Each segment yields a 0 or a 1, and the watermarking vendor extracts the identifier from the sequence.
A delivery mechanism, not a watermarking algorithm
A/B watermarking is best understood as a mechanism for delivering watermarks efficiently over streaming, rather than as an algorithm for embedding or extracting them. The 0 and 1 are two versions of the video, each marked with a different watermark by a watermarking algorithm. A/B describes how those versions reach each viewer.
The mechanism exists because of encoding time. Generating and embedding a watermark for each user request would take too long. So the 0 and 1 versions are made in advance, and when a request arrives, the 0s and 1s are sent in order, one per segment length, which produces a stream with a unique value.
A/B services share a delivery structure, but performance varies. Imperceptibility and robustness vary with the algorithm behind the variants. The specification reflects this split: it leaves the derivation of indirect-mode patterns to vendors, and says the minimum segment duration should consider the embedding capabilities of the watermarking technology. The MediaLive profiles offer HQ, Robust, and Camcording options on the same A/B structure.
The standard: DASH-IF Forensic A/B Watermarking
The DASH Industry Forum’s Content Protection and Security Task Force developed this specification over about four years, with watermarking vendors, CDN providers, and packager suppliers. DASH-IF published a candidate specification in June 2023, and ETSI published it as ETSI TS 104 002 on August 28, 2023.
It defines:
- A functional architecture in which the device is unaware of the watermark.
- A watermark token in CBOR, with direct and indirect modes.
- WMPaceInfo, metadata that carries each segment’s bit position from the encoder to the edge, which limits the need for naming conventions.
- The sequencing logic at the edge, including byte-range content and joint HLS and DASH delivery with different segment durations.
It also draws clear lines around its scope. Client-driven methods, where the client itself requests a unique sequence of URLs, are not covered. Neither is multiplexed audio and video in one segment, nor how detection and token revocation are performed.
At publication, NAGRA, Synamedia, and Irdeto issued statements of support. Implementations referencing it now include AWS Elemental MediaLive and MediaPackage, the Akamai EdgeWorkers module, and Unified Streaming’s VOD workflow.
The end-to-end pipeline
Content preparation. The encoder and watermark preprocessor produce both variants of each rendition. The packager encrypts and packages them. The variants of a segment may share a content key, so the same DRM license decrypts either.
Token issue. The device obtains a watermark token before requesting segments, either from a token server or alongside other playback data.
Delivery. The edge validates the token on every segment request and delivers the matching variant.
Detection and response. The specification expects a capture of several minutes without commercial breaks. The watermarking provider extracts the ID, and the responsible party matches it to a device, user, or session and takes action.
What the edge does on each request
The specification calls this step sequencing.
The bit lookup uses big-endian addressing. The specification gives this example: for the pattern 0x0A0B0C0D, position 3 is the fourth bit of the first byte.
Byte 0 1 2 3
Offset 01234567 01234567 01234567 01234567
Binary 00001010 00001011 00001100 00001101
Position 3 reads 0, so the edge serves Variant A. The edge then forwards a request for /path/video_segment_5_8353305.mp4 to the origin as /path/${variantPath}video_segment_5_8353305.mp4, where variantPath identifies the variant, for example a/ or b/, and may be empty for the first variant.
Two inputs make this work: the token, and the position.
The token
The token tells the edge which pattern applies. In ETSI TS 104 002 it is a signed CBOR Web Token (CWT), with exp and iat required. Two modes exist:
- Direct mode. The token contains the pattern itself, with encryption recommended, and can be interpreted by an edge regardless of the watermarking provider. Edges must support this mode.
- Indirect mode. The token contains a watermark ID, an operator ID, and a key version, and vendor-specific code at the edge derives the pattern.
The token can travel in the virtual path, a query string, or an HTTP header, and the specification recommends the virtual path. If a segment request arrives without a token, the edge must reject it.
The position
The edge also has to know which bit of the pattern applies to this segment. That information is carried in WMPaceInfo metadata produced by the encoder.
| Field | Used by | Meaning |
|---|---|---|
position | Edge | Zero-based index into the pattern. -1 means the segment is not watermarked |
variant | Edge | Which variant this is, for integration and debugging |
firstpart | Packager, origin | This is the first piece with this position value |
lastpart | Packager, origin | This is the last piece with this position value |
HLS and DASH may use different segment durations, and a packager may aggregate ingest segments into longer egress segments, but only segments with the same position. WMPaceInfo reaches the edge as an HTTP header or as a sidecar file at /pathname/WMPaceInfo/filename, and direct device requests for that path must get a 403. When WMPaceInfo is not available, an optional wmsegduration token claim gives the nominal segment duration, which may allow the edge to define the index.
The specification also covers variant loss. Setting position to -1 tells the edge the segments are not watermarked, and it uses the Variant A endpoint. That period is not used for detection.
On AWS
The AWS and Akamai details reflect their public documentation in November 2026.
VOD: MediaConvert
MediaConvert integrates Nagra’s NexGuard File Marker. For OTT, the documented recipe is two output groups, one with the Payload ID set to 0 in every output and one set to 1, which creates two ABR stacks. It requires a license and preset from Nagra.
A partner workflow watermarks after encoding. In the Synamedia workflow AWS published in 2022, MediaConvert produces the encode, a watermark inserter on ECS creates the A and B copies, and MediaPackage packages them. The article states this saves close to half of the encoding cost of encoding both copies.
Live: MediaLive and MediaPackage
In September 2026, AWS added A/B forensic watermarking to MediaLive, following ETSI TS 104 002. One channel produces two variants of each rendition, and sends A to the regular destination and B to a paired alternate destination. Irdeto is the first available implementation, and the license is arranged with Irdeto directly. Documented requirements include:
- It applies only to CMAF Ingest and MediaPackage v2 output groups.
- The channel must use epoch locking, and the input must carry an embedded UTC timecode.
- Output width must be 240 to 3840 pixels, and output height must be 240 to 2160 pixels.
- Output frame rates must be set explicitly, not initialized from the source.
- Watermark ID Length is 512 or 2048 bits and must match the license.
- A profile (Default, Mezzanine, HQ, Robust, Camcording, or Custom) is selected for the output group. Custom exposes settings such as target PSNR.
MediaPackage reads a WMPaceInfoIngest header on each incoming segment and keeps each output segment within one bit position. Its documentation gives this example: a 2-second encoder segment with a poly period of 3 matches a 6-second origin segment. Occasional shorter segments can appear at watermark boundaries.
The documentation lists two conditions that do not stop the channel. If watermarking is misconfigured, MediaLive disables it for that output group and keeps producing video. If the input has no usable UTC timecode, the channel runs but the watermark is not correctly sequenced and cannot be reliably detected.
An earlier partner architecture is NexGuard’s, published on AWS in 2022. It runs two MediaLive channels that overlay invisible images to create A and B, and has MediaPackage package the result.
The edge: CloudFront Functions or Lambda@Edge
MediaLive does not perform per-viewer selection or create viewer-facing manifests. AWS’s documentation assigns that to the downstream origin or CDN. Published CloudFront integrations use one of two options.
| CloudFront Functions | Lambda@Edge | |
|---|---|---|
| Duration | Submillisecond | Up to 30 seconds |
| Network access | No | Yes |
| Code size | 10 KB | 50 MB |
| Scale | Up to millions of requests per second | Up to 10,000 requests per second per Region |
| Used by | NexGuard reference architecture | Synamedia VOD workflow, DoveRunner embedder |
CloudFront Functions gained a built-in CWT module in November 2025. It supports the MAC0 structure with HS256, up to a maximum token size of 1 KB, and keys are commonly kept in CloudFront KeyValueStore.
Ad insertion
Server-side ad insertion and A/B watermarking both rewrite the manifest, and rewriting can drop a token carried in the playback URL. AWS’s 2023 pattern keeps the token in the path, strips it at the CDN before the request reaches MediaTailor, and uses MediaTailor’s ContentSegmentUrlPrefix to keep segment URLs relative. For DASH, MediaTailor may redirect with an absolute URL that loses the token, and a viewer-response function rewrites the location.
On Akamai
In Akamai’s model, a third-party vendor prepares the variants and issues tokens, the player passes the token along, and Akamai verifies it and maps each request to a variant. Akamai documents two ways to do the last part.
The Watermarking behavior in Adaptive Media Delivery
This is a property setting rather than code. It is enabled on an AMD property and configured with:
- Signature verification, with a key ID and a public key. A second pair is optional.
- Pattern encryption, with a decryption password and ID. A second pair supports rotation.
- A/B variant location, which matches the vendor’s origin layout. Either
1080/a.segment_1.tsand1080/b.segment_1.ts(filename prefix), or1080/A/segment_1.tsand1080/B/segment_1.ts(directory prefix). - Use Original as A, which leaves the A copies at the default path, so watermarking can later be turned off without moving files.
The token here is a JWT, with claims such as wmver and wmid, or wmidctb64 for a pattern encrypted with AES-CBC. It can be sent as a virtual path component, which Akamai recommends and removes before going to the origin, or in an Authorization header or query parameter, both of which need player code.
Akamai’s documentation lists these considerations:
- Akamai must deliver the HLS manifests as well as the segments.
- Range requests are not supported.
- Multi-CDN is not supported. A mid-stream switch needs a matching implementation on the other CDN.
- AMD failover and prefetching do not work with it.
- Media Services Live is not supported, and the origin must be your own or NetStorage. The formats page lists live as limited, and only with a specific vendor.
- DASH requires
SegmentTemplatewith$Number$as the last element of the filename, preceded by an underscore. Init files must end in_init, or they get a 403.
The EdgeWorkers watermarking module
Akamai also provides a watermarking module for EdgeWorkers that follows the DASH-IF specification. It handles JWT and CWT tokens, direct mode with an encrypted pattern, and indirect mode through vendor algorithms that you supply. getWMPathWithVariant() takes the request path, the token payload, a key, and an optional range header, and returns the variant, using a position value from a sidecar file.
It requires the Dynamic Compute resource tier, and Akamai notes a known compatibility issue with partial object caching.
Access Revocation
Akamai documents a response path. The service stores a mapping between the auth token’s session_id and the watermark ID. When the vendor reports a detected ID, the session_id goes on a revocation list through the Access Revocation API, and requests carrying that token are blocked.
AWS and Akamai side by side
| AWS | Akamai | |
|---|---|---|
| Creating variants | MediaConvert (NexGuard) for VOD, MediaLive (Irdeto) for live, or partner tools | Third-party vendor preprocessing |
| Edge logic | A function in CloudFront Functions or Lambda@Edge | AMD Watermarking behavior, or the EdgeWorkers module |
| Token | JWT in the NexGuard architecture. Built-in CWT module (HS256) | JWT in AMD. JWT or CWT in EdgeWorkers |
| Bit position | MediaPackage keeps one position per output segment | Segment number in AMD. Sidecar in EdgeWorkers |
| Live | MediaLive and MediaPackage | Limited in AMD, with a specific vendor |
| Response | Partner workflows, such as Synamedia’s account deny-list | Access Revocation API |
Segment length, payload length, and video length
A/B watermarking carries at most one bit per segment. With 2-second segments, that is up to 1 bit of information every 2 seconds. The minimum video length needed for detection therefore depends on the payload length and the segment length. The specification says the capture should be several minutes, and that longer segments need a longer capture. It also notes that consecutive segments carrying the same position value increase the amount of content needed.
More than two variants
Depending on the product, three or four versions are generated instead of two, so a segment carries more than 1 bit. Four versions carry 2 bits. The specification’s ingest signaling allows for this, with Variant C as its example of additional variants.
The cost is that every version has to be generated in advance, which multiplies the storage needed. For that reason this approach is not widely used. The table compares storage against a single copy, and shows the video needed to carry 60 bits at 2-second segments.
| Versions | Bits per segment | Storage | Video for 60 bits |
|---|---|---|---|
| 2 (A/B) | 1 | 2× | 120 seconds |
| 3 | About 1.58 | 3× | About 76 seconds |
| 4 | 2 | 4× | 60 seconds |
Short-form video is the exception. A short video has little room for a long payload, and it takes little storage to begin with, so 2 bits per segment solves both problems. A 60-second clip with 2-second segments has 30 segments, which is 30 bits with A/B and 60 bits with four versions.
How it gets attacked
Collusion. The A/B structure itself is vulnerable to collusion. Every session is assembled from the same two prepared copies, so pirates holding several sessions can mix their segments into a stream that is still made of valid variants, weakening the link to any single source. Wherever their patterns differ, they can pick either variant. Irdeto puts it this way: collusion “does not necessarily remove the watermark,” but distorts the recovered identity and makes accusation less certain.
The theory of collusion-secure codes goes back to Boneh-Shaw and Tardos. Tardos codes grow in length with the square of the number of colluders, and at one bit per segment, a longer code needs more video. Irdeto reports results with 25 colluders in a user base of one million, and NAGRA describes its sequence as resilient to collusion. Both are vendor claims.
Breaking the sequence. Synamedia describes attackers switching sources, adding gaps or jitter, and splicing streams to break sequence continuity.
Going around the sequencing. The specification requires the connection between origin and edge to be restricted to legitimate requests, says edges should not reveal cache keys through debug headers, and forbids byteranges overlapping segments with different positions. DoveRunner notes that its manifests use the same path and filename for all users, to protect against mixing segment lists across sessions.
Capture and re-encoding. The AWS announcement describes marks that survive re-encoding and screen capture, and the MediaLive profiles include HQ, Robust, and Camcording options.
References
- ETSI, “TS 104 002 V1.1.1: DASH-IF Forensic A/B Watermarking,” August 2023.
- DASH-IF, “DASH-IF Publishes Forensic A/B Watermarking Specification as ETSI TS 104 002.”
- Unified Streaming, “Watermarking.”
- AWS, “Creating A/B forensic video watermarks,” “Setting up A/B video watermarking,” and “Troubleshooting,” AWS Elemental MediaLive User Guide.
- AWS, “AWS Elemental MediaLive adds support for A/B forensic watermarking,” September 2026.
- AWS, “A/B forensic watermarking in AWS Elemental MediaPackage.”
- AWS, “NexGuardFileMarkerSettings,” MediaConvert API reference.
- AWS for M&E Blog, “Securing premium live content with NAGRA NexGuard forensic watermarking on AWS,” August 2022.
- AWS for M&E Blog, “Protecting over-the-top streaming with watermarking and disruption from Synamedia and AWS, Part II: VOD,” June 2022.
- AWS for M&E Blog, “Combining dynamic ad insertion and A/B watermarking,” February 2023.
- AWS, “Differences between CloudFront Functions and Lambda@Edge” and “CWT support for CloudFront Functions.”
- Akamai, “Watermarking,” Adaptive Media Delivery documentation, including property setup, source content preprocessing, the watermarking token, key considerations, and Access Revocation.
- Akamai, “Watermarking,” EdgeWorkers documentation.
- DoveRunner, “Forensic Watermarking Concepts and Specifications,” “Integration Workflow,” and “CloudFront Embedder.”
- Irdeto, “Modern forensic watermarking at scale,” April 2026. Vendor source.
- Synamedia, “Edge watermarking: shortening the distance from piracy to disruption.” Vendor source.
- ATEME, “Watermarking: securing sports streams, protecting profits.” Vendor source, spotlight on NAGRA.
- D. Boneh, J. Shaw, “Collusion-Secure Fingerprinting for Digital Data,” IEEE Transactions on Information Theory, 44(5), 1998.
- G. Tardos, “Optimal Probabilistic Fingerprint Codes,” STOC, 2003.