NexGuard FileMarker is based on the concept of A/B watermarking. If you enable it for an input stream the Bitmovin encoder will automatically generate two output streams. The A stream and the B stream.
The A stream will follow your configured segment naming template (e.g. segment\_0.ts) while the B stream is prefixed with b. (e.g.: b.segment\_0.ts). When one of your customers starts watching a protected video, your CDN will serve them unique sequence of A and B segments. This unique sequence enables you to trace any leaked video to the time and customer you originally provided the video for.
Encoder version 2.62 or higher
A Nagra Account to obtain license and configuration values
# Known Limitations
The NexGuard FileMarker Specification exposes multiple restrictions to the encoding to ensure that a video is compatible with the different CDN providers. A non exhaustive list of restrictions is given here:
#### Supported Muxings
#### Segment Naming conventinons
Segment naming must be `
Init naming must be `
The Nagra NexGuard FileMarker relies heavily on the naming scheme of your segments and of the init file to be able to do the a/b switching correctly. The filename can be chosen freely. For segments we would recommend the default e.g. `
segment_<number>.m4s` and for the init segment we would recommend a unique filename with which you can identify your video e.g.: `
#### Supported Framerates
#### Supported Resolution
320` \<= `
width` \<= `
240` \<= `
height` \<= `
GOP` size has to be `
2` or `
Minimum length of the video asset - Required to ensure that a unique sequence of A and B segments can be generated.
# Create an Encoding
This tutorial is based on our [Per-Title Encoding Example on Github](🔗) and will state only the adjustments it would need to create NexGuard Watermarking compatible content.
As with every encoding, we will need an `
Encoding` Object, that holds all related configuration objects, as well as an `
Input` and `
#### Create or reuse an Input
HTTP is just used for simplicity in this example, as there is no limitation in where the input file can be downloaded from for that use-case. Of course, you can also reuse existing `
Input` objects available in your Bitmovin Account.
#### Create or reuse an Output
Akamai NetStorage is used knowing that the Akamai CDN does support the Nagra FileMarker Specification. Of course, you can also reuse existing Input objects available in your Bitmovin Account.
**IMPORTANT**: While you can write this content to any support `
Output`, make sure that your CDN supports the NexGuard FileMarker specification to make use of the A/B watermarking, otherwise you won't be able to use it.
# Create an H264 Video Configuration
Make sure that you to configure a supported frame rate and gop size. As stated in "Known Limitations", NexGuard Watermarking requires a GOP size of 2 seconds. The Bitmovin API requires the GOP size in frames. To convert between the two calculate frame rate \_required gop size in seconds. E.g. in this case 24x2 equals a max gop size of 48.
# Create Video Stream
Stream` Object effectively maps a stream of the input file to a given `
CodecConfiguration`, in this case the one created in the step before.
# Add NexGuard FileMarker to Video Stream
To enable the NexGuard Watermarking on the video streams, we will configure the `
NexGuardFileMarker` object and create it with a reference to the `
videoStream` from before.
**HINT:** The values for the fields `
license` and `
preset` are provided to you by your Nagra contact. Please see the [API Reference](🔗) for all available properties.
# Create a Video Muxing
Next we configure a muxing for the stream. Note that the init segment needs to be follow the `
<filename>_init.mp4` naming template stated in `
# Create a Audio Codec Configuration
# Create a Audio Stream
# Add Nexguard Filemarker to Audio Stream
Theoretically it is possible to mix non watermarked and watermarked streams in a single encoding, therefore we will need to tell the Encoder that this audioStream is part of the watermarking process and needs to be `
This duplication is necessary because NexGuard enabled CDNs do the A/B switching only based on the file extension and both audio and video segments usually share the same extension.