C2PAService

data-variant=info
data-slots=text
UXP for Adobe Media Encoder is in public beta. This reference is being written, and the supported API surface may change before general availability.

Since: 27.0

The C2PAService object provides access to Content Credentials (C2PA) manifest data embedded in, or associated with, a media file. Use getManifest to read the manifest for a given file path.

The C2PAService object can be accessed from the main app object:

const app = require("mediaencoder");
const c2paService = app.C2PAService;

Constants

These C2PA Manifest Location Flags are class properties, accessed via the C2PAService object itself, and indicate where a manifest was found when returned from getManifest.

const app = require("mediaencoder");
const MANIFEST_LOCATION_EMBEDDED = app.C2PAService.MANIFEST_LOCATION_EMBEDDED;

MANIFEST_LOCATION_NONE

Content credentials NONE. No manifest found in the provided asset.

Type: number (readonly)

Since: 27.0

MANIFEST_LOCATION_EMBEDDED

Content credentials EMBEDDED. An embedded manifest was found.

Type: number (readonly)

Since: 27.0

MANIFEST_LOCATION_SIDE_CAR

Content credentials SIDE_CAR. A sidecar manifest was found.

Type: number (readonly)

Since: 27.0

MANIFEST_LOCATION_CLOUD

Content credentials CLOUD. A reference to a cloud manifest was found.

Type: number (readonly)

Since: 27.0

Methods

getManifest

Class method. Returns an object with manifest (JSON string) and manifestLocation (number) indicating where the C2PA manifest was found. Location flags: MANIFEST_LOCATION_NONE (0), MANIFEST_LOCATION_EMBEDDED (1), MANIFEST_LOCATION_SIDE_CAR (2), MANIFEST_LOCATION_CLOUD (4). If withValidation is true, the file will be validated during processing.

Since: 27.0

Parameters

Name
Type
Description
filePath
string
File path to the media file to read the manifest from
withValidation
boolean
If true, the file will be validated during processing

Returns

Name
Type
Description
manifest
string
The C2PA manifest as a JSON string
manifestLocation
number
Where the manifest was found; one of the MANIFEST_LOCATION_* constants
const app = require("mediaencoder");
const result = app.C2PAService.getManifest("path/to/file.mp4", true);
result; // { manifest: "{...}", manifestLocation: 1 }