ElvClient/ABRPublishing

Methods for ABR video creation and management

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

Source:

Methods

static CreateABRMezzanine({
abrProfileoptional,
addlOfferingSpecsoptional,
descriptionoptional,
keepOtherStreamsoptional,
libraryId,
masterVersionHash,
metadataoptional,
name,
objectIdoptional,
offeringKeyoptional,
respLogLeveloptional,
structLogLeveloptional,
streamKeys,
typeoptional,
variantoptional
})
→ Object

Create (or edit) a mezzanine offering based on the 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:
Name Type Attributes Default Description
abrProfile Object <optional>

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

addlOfferingSpecs Object <optional>

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

description string <optional>

Description for mezzanine content object

keepOtherStreams boolean <optional>
false

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

libraryId string

ID of the mezzanine library

masterVersionHash string

The version hash of the production master content object

metadata Object <optional>

Additional metadata for mezzanine content object

name string

Name for mezzanine content object

objectId string <optional>

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

offeringKey string <optional>
default

The key of the offering to create

respLogLevel "warn" | "info" | "debug" <optional>
warn

The level of logging to return in http response

structLogLevel "none" | "error" | "warn" | "info" | "debug" <optional>
none

The level of logging to save to object metadata

streamKeys Array.<string>

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

type string <optional>

ID or version hash of the content type for the mezzanine

variant string <optional>
default

What variant of the master content object to use

Example
async CreateABRMezzanine({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "masterVersionHash": "hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
  "type": "ABR Master",
  "name": "Mezzanine Test",
  "description": "Mezzanine Test Description",
  "metadata": {
    "test": "mezzanine"
  }
});


{
  "logs": [
    "2021-03-09 20:06:31 Debug: apiAbrMezzanineInit()",
    "2021-03-09 20:06:31 Info: Get abr.Profile from lib",
    "2021-03-09 20:06:31 Info: Get abr.Profile from lib metadata /abr_profile",
    "2021-03-09 20:06:31 Info: Get production.Master",
    "2021-03-09 20:06:31 Debug: getProductionVariantCtx(hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH,default)",
    "2021-03-09 20:06:31 Debug: getting production.Master: hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
    "2021-03-09 20:06:31 Debug: Get production.Variant 'default' from production.Master",
    "2021-03-09 20:06:31 Info: Generate abr.Offering",
    "2021-03-09 20:06:31 Info: Saving metadata"
  ],
  "warnings": [],
  "errors": [],
  "id": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
  "hash": "hq__36T8woJSLJoC7TfTqsRsME3wBcTTedb21UWkFB3L9seesLG7E86CXm8e7uCP9GfrihPfFwXp9M",
  "write_token": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLH9gYQEBDzxECpugP8g7Mp2",
  "type": "hq__J39WocoEB1hc19t3o1YUaZM2PAzhRvLck6NVmFFviSTRM5yvVTcJ4SJeULw3VarH6mD6xkfjaC",
  "qlib_id": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV"
}
Source:

static CreateProductionMaster({
libraryId,
typeoptional,
name,
descriptionoptional,
contentTypeName,
metadataoptional,
fileInfooptional,
encryptoptional,
copyoptional,
callbackoptional,
respLogLeveloptional,
structLogLeveloptional,
accessoptional
})
→ 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:
Name Type Attributes Default Description
libraryId string

ID of the library

type string <optional>

ID or version hash of the content type for this master

name string

Name of the content

description string <optional>

Description of the content

contentTypeName string

Name of the content type to use

metadata Object <optional>

Additional metadata for the content object

fileInfo Array.<Object> <optional>

Files to upload (See UploadFiles/UploadFilesFromS3 method)

encrypt boolean <optional>
true

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

copy boolean <optional>
false

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

callback function <optional>

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

respLogLevel "warn" | "info" | "debug" <optional>
warn

The level of logging to return in http response

structLogLevel "none" | "error" | "warn" | "info" | "debug" <optional>
none

The level of logging to save to object metadata

access Array.<Object> <optional>
[

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
Throws:

error - If the initialization of the master fails, error details can be found in error.body

Type
Object
Example
async CreateProductionMaster({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "type": "Production Master",
  "name": "Production Master Test",
  "description": "Production Master Test Description",
  "metadata": {
    "test": "master"
  },
  "fileInfo": [
    {
      "path": "Video.mp4",
      "mime_type": "video/mp4",
      "size": 3738907,
      "data": "<ArrayBuffer 3738907>"
    }
  ]
});


{
  "errors": [],
  "logs": [
    "2021-03-09 20:06:22 Debug: avtest.initProdMaster()",
    "2021-03-09 20:06:22 Info: Get list of files from object",
    "2021-03-09 20:06:22 Info: 2 item(s) found in file list.",
    "2021-03-09 20:06:22 Info: Skipping '.'",
    "2021-03-09 20:06:22 Info: Analyzing Video.mp4",
    "2021-03-09 20:06:22 Debug: getAvpReqCtx filePath=Video.mp4 qhot=tqw__HSRoazbriLdH7CGobx96kWaZqkqo2Z1x9Qru5h5n1FyhfX9W6FkWjBH3EikHKUoFLLq3Jf5ZLbTL2UJjFwA key=tqw__HSRoazbriLdH7CGobx96kWaZqkqo2Z1x9Qru5h5n1FyhfX9W6FkWjBH3EikHKUoFLLq3Jf5ZLbTL2UJjFwA.txAll.Video.mp4",
    "2021-03-09 20:06:22 Info: Successfully generated default variant"
  ],
  "warnings": [],
  "id": "iq__fQhR2f757MCYQ7SNrwKh39XeSPs",
  "hash": "hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
  "write_token": "tqw__HSRoazbriLdH7CGobx96kWaZqkqo2Z1x9Qru5h5n1FyhfX9W6FkWjBH3EikHKUoFLLq3Jf5ZLbTL2UJjFwA",
  "type": "hq__AsSK6q2Jh8vetffArMHiyMhEgQD4fyni1g5PgeBSPcKERMJv5hbuyAd3aNQTaeJD9ounyKTUEu",
  "qlib_id": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV"
}
Source:

static FinalizeABRMezzanine({
libraryId,
objectId,
writeToken,
preFinalizeFnoptional,
preFinalizeThrowoptional
})
→ Promise.<Object>

Finalize a mezzanine object after all jobs have finished

Returns: The finalize response for the mezzanine object, as well as any logs, warnings and errors from the finalization
Parameters:
Name Type Attributes Description
libraryId string

ID of the mezzanine library

objectId string

ID of the mezzanine object

writeToken string

Write token for the mezzanine object

preFinalizeFn function <optional>

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.

preFinalizeThrow boolean <optional>

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.

Example
async FinalizeABRMezzanine({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
});


{
  "logs": [
    "2021-03-09 20:07:22 Debug: getProductionVariantCtx(hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH,default)",
    "2021-03-09 20:07:22 Debug: getting production.Master: hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
    "2021-03-09 20:07:22 Debug: Get production.Variant 'default' from production.Master"
  ],
  "warnings": [],
  "errors": [],
  "id": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
  "hash": "hq__AXQrQWT8v1Xe784ciwaFJoXphaeoXHJzsG3JY8NHTsXZcZ18jqx6dPfqT8268c8Aoq5VnsmC3",
  "write_token": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLNBUX6qWhcPxkCyMnoAaHpW",
  "type": "hq__J39WocoEB1hc19t3o1YUaZM2PAzhRvLck6NVmFFviSTRM5yvVTcJ4SJeULw3VarH6mD6xkfjaC",
  "qlib_id": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV"
}
Source:

static 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.

Returns: LRO status
Parameters:
Name Type Description
libraryId string

ID of the library

objectId string

ID of the object

Example
async LRODraftInfo({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy"
});


{
    "node": "https://host-76-74-28-234.contentfabric.io/",
    "offering": "default",
    "write_token": "tqw__HSR7Au7qqAZpAQWf8MKdCHpTvBor5fSRU49m1sjhgZd2w4fgHUoQNpKGkmAic9NpayTkJzwkeZeFVn94Fpa"
}
Source:

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

Retrieve status information for mezzanine transcoding jobs, aka long running operations (LROs) on the given object.

Returns: LRO status
Parameters:
Name Type Description
libraryId string

ID of the library

objectId string

ID of the object

Examples
async LROStatus({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy"
});


{
  "tlro1EjchYzPaMx7VJV3JM8EmxaSfnyK4UDUoqAqs5QZSgrfL1gtU9o1Q4": {
    "desc": "stream: video, offering: default, variant: default, masterHash: hq__HC7mRr9J39eVmsoSRkfDC8k4g7oGpKpgWDKGYHnwZC78zzcPDSsNz362Hm9qgw8M87h9uLpvTK",
    "duration": 0,
    "duration_ms": 0,
    "key": "video.default.xcVideo.Meridian-video-1080p-audio-English-stereo.mp4.tqw__HSXggshfz4Y9TSCrcfdxmYUAZ2zCAXWXj3Epe13k8eiP7tGRQphN856Y1Aheyikuz3WQJcV4rP79q8t6qm6",
    "name": "MEZMAKER VIDEO (stream key: video)",
    "progress": {
      "percentage": 0
    },
    "run_state": "running",
    "start": "2023-02-15T02:39:31Z"
  },
  "tlro1EjchYzPaMx7VJV3JM8EmxaSfnyK4UDUsWHgxwgCLp8gtYPKdMLnN5": {
    "desc": "stream: audio, offering: default, variant: default, masterHash: hq__HC7mRr9J39eVmsoSRkfDC8k4g7oGpKpgWDKGYHnwZC78zzcPDSsNz362Hm9qgw8M87h9uLpvTK",
    "duration": 0,
    "duration_ms": 0,
    "key": "audio.default.xcAudio.Meridian-video-1080p-audio-English-stereo.mp4.tqw__HSXggshfz4Y9TSCrcfdxmYUAZ2zCAXWXj3Epe13k8eiP7tGRQphN856Y1Aheyikuz3WQJcV4rP79q8t6qm6",
    "name": "MEZMAKER AUDIO (stream key: audio)",
    "progress": {
      "percentage": 0
    },
    "run_state": "running",
    "start": "2023-02-15T02:39:31Z"
  }
}
async LROStatus({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy"
});


{
  "tlro1EjchYzPaMx7VJV3JM8EmxaSfnyK4UDUoqAqs5QZSgrfL1gtU9o1Q4": {
    "desc": "stream: video, offering: default, variant: default, masterHash: hq__HC7mRr9J39eVmsoSRkfDC8k4g7oGpKpgWDKGYHnwZC78zzcPDSsNz362Hm9qgw8M87h9uLpvTK",
    "duration": 291813000000,
    "duration_ms": 291813,
    "key": "video.default.xcVideo.Meridian-video-1080p-audio-English-stereo.mp4.tqw__HSXggshfz4Y9TSCrcfdxmYUAZ2zCAXWXj3Epe13k8eiP7tGRQphN856Y1Aheyikuz3WQJcV4rP79q8t6qm6",
    "name": "MEZMAKER VIDEO (stream key: video)",
    "progress": {
      "percentage": 41.66666666666667
    },
    "run_state": "running",
    "start": "2023-02-15T02:39:31Z"
  },
  "tlro1EjchYzPaMx7VJV3JM8EmxaSfnyK4UDUsWHgxwgCLp8gtYPKdMLnN5": {
    "desc": "stream: audio, offering: default, variant: default, masterHash: hq__HC7mRr9J39eVmsoSRkfDC8k4g7oGpKpgWDKGYHnwZC78zzcPDSsNz362Hm9qgw8M87h9uLpvTK",
    "duration": 292498000000,
    "duration_ms": 292498,
    "key": "audio.default.xcAudio.Meridian-video-1080p-audio-English-stereo.mp4.tqw__HSXggshfz4Y9TSCrcfdxmYUAZ2zCAXWXj3Epe13k8eiP7tGRQphN856Y1Aheyikuz3WQJcV4rP79q8t6qm6",
    "name": "MEZMAKER AUDIO (stream key: audio)",
    "progress": {
      "percentage": 41.66666666666667
    },
    "run_state": "running",
    "start": "2023-02-15T02:39:31Z"
  }
}
async LROStatus({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy"
});


{
  "tlro1EjchYzPaMx7VJV3JM8EmxaSfnyK4UDUoqAqs5QZSgrfL1gtU9o1Q4": {
    "desc": "stream: video, offering: default, variant: default, masterHash: hq__HC7mRr9J39eVmsoSRkfDC8k4g7oGpKpgWDKGYHnwZC78zzcPDSsNz362Hm9qgw8M87h9uLpvTK",
    "duration": 554273000000,
    "duration_ms": 554273,
    "end": "2023-02-15T02:48:45Z",
    "key": "video.default.xcVideo.Meridian-video-1080p-audio-English-stereo.mp4.tqw__HSXggshfz4Y9TSCrcfdxmYUAZ2zCAXWXj3Epe13k8eiP7tGRQphN856Y1Aheyikuz3WQJcV4rP79q8t6qm6",
    "name": "MEZMAKER VIDEO (stream key: video)",
    "progress": {
      "percentage": 100
    },
    "run_state": "finished",
    "start": "2023-02-15T02:39:31Z"
  },
  "tlro1EjchYzPaMx7VJV3JM8EmxaSfnyK4UDUsWHgxwgCLp8gtYPKdMLnN5": {
    "desc": "stream: audio, offering: default, variant: default, masterHash: hq__HC7mRr9J39eVmsoSRkfDC8k4g7oGpKpgWDKGYHnwZC78zzcPDSsNz362Hm9qgw8M87h9uLpvTK",
    "duration": 550089000000,
    "duration_ms": 550089,
    "end": "2023-02-15T02:48:41Z",
    "key": "audio.default.xcAudio.Meridian-video-1080p-audio-English-stereo.mp4.tqw__HSXggshfz4Y9TSCrcfdxmYUAZ2zCAXWXj3Epe13k8eiP7tGRQphN856Y1Aheyikuz3WQJcV4rP79q8t6qm6",
    "name": "MEZMAKER AUDIO (stream key: audio)",
    "progress": {
      "percentage": 100
    },
    "run_state": "finished",
    "start": "2023-02-15T02:39:31Z"
  }
}
Source:

static StartABRMezzanineJobs({
libraryId,
objectId,
accessoptional,
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:
Name Type Attributes Description
libraryId string

ID of the mezzanine library

objectId string

ID of the mezzanine object

access Array.<Object> <optional>

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}
jobIndexes Array.<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

Example
async StartABRMezzanineJobs({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
});


{
  "lro_draft": {
    "write_token": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLNBUX6qWhcPxkCyMnoAaHpW",
    "node": "https://host-34-105-49-255.testv2.contentfabric.io/",
    "offering": "default"
  },
  "writeToken": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLNBUX6qWhcPxkCyMnoAaHpW",
  "data": [
    "c056f89b-53f3-4aac-8b83-bd996cd37baf",
    "9ea07c9c-6f8a-41a0-b721-8fd7d72d82c8"
  ],
  "logs": [
    "2021-03-09 20:06:39 Debug: getAvpReqCtx filePath=Video.mp4 qhot=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH key=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH.txAudio.Video.mp4",
    "2021-03-09 20:06:39 Debug: getAvpReqCtx filePath=Video.mp4 qhot=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH key=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH.txVideo.Video.mp4"
  ],
  "node": "https://host-34-105-49-255.testv2.contentfabric.io/",
  "warnings": [],
  "errors": []
}
Source: