Skip to main content

ABRPublishing

Methods for ABR video creation and management

For more information on how to publish ABR content see this detailed guide

CreateABRMezzanine

CreateABRMezzanine({
  abrProfile, // optional
  addlOfferingSpecs, // optional
  description, // optional
  keepOtherStreams, // optional
  libraryId,
  masterVersionHash,
  masterWriteToken, // optional
  writeToken, // optional
  metadata, // optional
  name,
  objectId, // optional
  offeringKey, // optional
  respLogLevel, // optional
  structLogLevel, // optional
  streamKeys,
  type, // optional
  variant // optional
}) → Object

Create (or edit) a mezzanine offering based on a given master content object version and variant key

Returns: The finalize response for the object, as well as logs, warnings and errors from the mezzanine initialization

Parameters

NameTypeRequiredDescription
abrProfileObject

Custom ABR profile. If not specified, the profile of the mezzanine library will be used

addlOfferingSpecsObject

Specs for additional offerings to create by patching the offering being created/edited

descriptionstring

Description for mezzanine content object

keepOtherStreamsboolean

If objectId is specified, whether to preserve existing streams with keys other than the ones specified in production master

(default: false)
libraryIdstring

ID of the mezzanine library

masterVersionHashstring

The version hash of the production master content object

masterWriteTokenstring

The write token of the production master content object draft.

writeTokenstring

The write token of the mezzanine object draft. If specified, the object will not be finalized, and no extra version of the object will be created to hold "bread crumb" metadata entry /lro_draft

metadataObject

Additional metadata for mezzanine content object

namestring

Name for mezzanine content object

objectIdstring

ID of existing object (if not specified, new object will be created)

offeringKeystring

The key of the offering to create

(default: default)
respLogLevel"warn" | "info" | "debug"

The level of logging to return in http response

(default: warn)
structLogLevel"none" | "error" | "warn" | "info" | "debug"

The level of logging to save to object metadata

(default: none)
streamKeysArray.<string>

List of stream keys from variant to include. If not supplied all streams will be included.

typestring

ID or version hash of the content type for the mezzanine

variantstring

What variant of the master content object to use

(default: default)

CreateProductionMaster

CreateProductionMaster({
  libraryId,
  type, // optional
  name,
  description, // optional
  contentTypeName,
  writeToken, // optional
  metadata, // optional
  fileInfo, // optional
  encrypt, // optional
  copy, // optional
  callback, // optional
  respLogLevel, // optional
  structLogLevel, // optional
  access // optional
}) → Object

Create a master media content object with the given files.

  • If uploading using local files, use fileInfo parameter (see UploadFiles for format)
  • If uploading from S3 bucket, use access, filePath and copy, parameters (see UploadFilesFromS3 method)

Returns: The finalize response for the object, as well as logs, warnings and errors from the master initialization

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

typestring

ID or version hash of the content type for this master

namestring

Name of the content

descriptionstring

Description of the content

contentTypeNamestring

Name of the content type to use

writeTokenstring

Write token of the draft. If specified, the object will not be finalized.

metadataObject

Additional metadata for the content object

fileInfoArray.<Object>

Files to upload (See UploadFiles/UploadFilesFromS3 method)

encryptboolean

(Local or copied files only) - Unless false is passed in explicitly, any uploaded/copied files will be stored encrypted

(default: true)
copyboolean

(S3) If specified, files will be copied from S3

(default: false)
callbackfunction

Progress callback for file upload (See UploadFiles/UploadFilesFromS3 method)

respLogLevel"warn" | "info" | "debug"

The level of logging to return in http response

(default: warn)
structLogLevel"none" | "error" | "warn" | "info" | "debug"

The level of logging to save to object metadata

(default: none)
accessArray.<Object>

Array of cloud credentials, along with path matching regex strings - Required if any files in the masters are cloud references (currently only AWS S3 is supported)

  • If this parameter is non-empty, all items in fileInfo are assumed to be items in cloud storage
  • Format: [
  • {
  • path_matchers: ["FILE_PATH_MATCH_REGEX_1", "FILE_PATH_MATCH_REGEX_2" ...],
  • remote_access: {
  • protocol: "s3",
  • platform: "aws",
  • path: "YOUR_AWS_S3_BUCKET_NAME" + "/",
  • storage_endpoint: {
  • region: "YOUR_AWS_REGION_NAME"
  • },
  • cloud_credentials: {
  • access_key_id: "YOUR_AWS_S3_ACCESS_KEY",
  • secret_access_key: "YOUR_AWS_S3_SECRET"
  • }
  • }
  • },
  • {
  • path_matchers: [".*"], // <-- catch-all for any remaining unmatched items in fileInfo
  • remote_access: {
  • ...
  • }
  • },
  • ...
  • ]
  • The simplest case is a one element array with .path_matchers == [".*"], in which case the same credentials will be used for all items in fileInfo
(default: [)

FinalizeABRMezzanine

FinalizeABRMezzanine({
  libraryId,
  objectId,
  writeToken, // optional
  preFinalizeFn, // optional
  preFinalizeThrow // optional
}) → Promise.<Object>

Process completed mezzanine transcoding LRO(s), creating the final offering(s) from the transcode(s) Unless a writeToken is passed in, finalize the mez object working draft as well.

If a writeToken is not passed in, then it will be retrieved from /lro_draft of most recent version of object. This is a "bread crumb" entry that gets created by StartABRMezzanineJobs() - unless a writeToken was passed in to StartABRMezzanineJobs() also.

Returns: The finalize response for the mezzanine object, as well as any logs, warnings and errors from the finalization

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the mezzanine library

objectIdstring

ID of the mezzanine object

writeTokenstring

Write token for the mezzanine object. If specified, the object will not be finalized.

preFinalizeFnfunction

A function to call before finalizing changes, to allow further modifications to offering. The function will be invoked with {elvClient, nodeUrl, writeToken} to allow access to the draft and MUST NOT finalize the draft.

preFinalizeThrowboolean

If set to true then any error thrown by preFinalizeFn will not be caught. Otherwise, any exception will be appended to the warnings array returned after finalization.

LRODraftInfo

LRODraftInfo({
  libraryId,
  objectId
}) → Promise.<Object>

Retrieve node and write token for a mezzanine's current offering preparation job (if any). Also returns the offering key.

This information is contained in metadata at /lro_draft, in an extra version of the object that gets created and finalized as part of creating a mezzanine. This serves as a "bread crumb trail" to allow users to find the active draft/write token that the ingest LROs are writing to.

Returns: LRO status

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

LROStatus

LROStatus({
  libraryId,
  objectId,
  writeToken // optional
}) → Promise.<Object>

Retrieve status information for mezzanine transcoding jobs, aka long running operations (LROs) on the given object. If a write token is passed in, its draft will be checked directly by lookiing at /lro_status. If a write token is not passed in, then the latest version of objectId will be checked for "bread crumb" entry at /lro_draft, to determine the write token that current ingest LRO(s) are writing to.

Returns: LRO status

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the library

objectIdstring

ID of the object

writeTokenstring

Write token of the active draft (that the transcode LROs are writing to)

StartABRMezzanineJobs

StartABRMezzanineJobs({
  libraryId,
  objectId,
  writeToken, // optional
  access, // optional
  jobIndexes
}) → Promise.<Object>

Start transcoding jobs previously set up by CreateABRMezzanine() on the specified mezzanine

Returns: A write token for the mezzanine object, as well as any logs, warnings and errors from the job initialization

Parameters

NameTypeRequiredDescription
libraryIdstring

ID of the mezzanine library

objectIdstring

ID of the mezzanine object

writeTokenstring

Write token of the mezzanine object draft. If provided, no "bread crumb" metadata /lro_draft will be created, nor saved as an extra finalized version

accessArray.<Object>

Array of S3 credentials, along with path matching regexes - Required if any files in the masters are S3 references (See CreateProductionMaster method)

  • Format: {region, bucket, accessKey, secret}
jobIndexesArray.<number>

Array of LRO job indexes to start. LROs are listed in a map under metadata key /abr_mezzanine/offerings/(offeringKey)/mez_prep_specs/, and job indexes start with 0, corresponding to map keys in alphabetical order