C2PAService
data-variant=info
data-slots=text
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
true, the file will be validated during processingReturns
MANIFEST_LOCATION_* constantsconst app = require("mediaencoder");
const result = app.C2PAService.getManifest("path/to/file.mp4", true);
result; // { manifest: "{...}", manifestLocation: 1 }