connect
search

Media Tasks

Media tasks are component types that alter a media item in a specific way or that can transition a media item from one status to another.

The following media tasks are supported:

Ensure access Task

Overview

Performs a database check on the media item which contains the fileLocator passed as input. If a media item is found, the task ends with SUCCESS. For the archived media items, the task also returns the Storage Class for the archived media items on the output.

Input

  • fileLocator: string - the locator of the media item that we want to check the storage status in S3.

Output

The Ensure access class task outputs can be referenced in workflows (for example in a Choice condition) using the $nameOfStep.property naming convention, where:

  • nameOfStep is the name that we give to the Ensure access Task in the Workflow Definition
  • property is a property of the Ensure access Task output

Example: $.EnsureAccess.fileStorageClass

  • fileId - the ID of the media item that it is registered within the Connect DB
  • fileUrl - the URL of the media item that it is registered within the Connect DB
  • fileStorageClass - the storage class that the media item is found in. It can be one of the following options:
    • STANDARD
    • REDUCED_REDUNDANCY
    • STANDARD_IA
    • ONEZONE_IA
    • INTELLIGENT_TIERING
    • GLACIER
    • DEEP_ARCHIVE

Restore Task

Overview

Performs a database check on the media item which contains the fileLocator passed in the input.

If the media item exists in the database and is not archived, the task execution will end.

If the media item is archived, the task execution will start and proceed to restore the media item. The restore options that are used are configured in the Archive options section on the Storage tab of the organization settings.

This task is built in order to be used when the Check storage status Task fails because the file is archived.

When the Check storage status Task is inputted to a file which is archived, it sends out a failure message. A Choice mechanism can enhance a workflow to run Restore when Check storage status finds an archived file.

Input

  • fileLocator: string - the locator of the media item that we want to restore from S3
  • archiveRestorePeriodDays: number - the number of days that we intend to restore the media item is found in the GLACIER status
  • archiveDearchiveOption: DearchivingOption - the de-archiving option that will be used to restore the media item found in the GLACIER status. It can be one of the following:
    • 'Bulk'
    • 'Standard'
  • deepArchiveRestorePeriodDays: number - the number of days that we intend to restore the media item, if the media item is found in the DEEP ARCHIVE status
  • deepArchiveDearchiveOption: DearchivingOption - the de-archiving option that will be used to restore the media item found in the DEEP ARCHIVE status
    • 'Bulk'
    • 'Standard'
    • 'Expedited'

Output

  • fileId - the ID of the restored media item
  • fileLocatorUrl - the S3 locator of the restored media item

Restore task outputs can be referenced using the $.nameOfStep.property naming convention, where:

  • nameOfStep - the name that we give to the Restore task in the Workflow Definition
  • property - a property of the Restore task output

Example: $.Restore.fileId

Probe Task

Overview

Analyses the media item received as input, using the fileId property, in order to collect and store its technical metadata.

The Probe task can run on different media item types, such as media_container, image, or metadata. The media item type is determined based on the fileLocator and its url properties, which are stored on the media item that is sent to run in the task.

Input

  • fileId: string - the ID of the media item that we want to probe

Probe logic based on media item type

The Probe task will run different processes based on the media item type:

  • media_container - will always run MediaInfo regardless of type AND depending on extension:
    • .mxf - runs ffprobe and extractsEssence Properties
    • .atmos - runs atmos Probe
    • for the rest of the media items - runs ffprobe (without extracting essences)
  • image - runs MediaInfo (returning width, height, and bitDepth properties) for all image types, except:
    • .tif, .tiff, or any other image sequence - runs the same probe as for media_container
  • Metadata
    • runs only for .xml file extensions.
    • if the parsed .xml content has a DolbyLabsMDF tag - runs DolbyVision Probe
  • CPL
    • runs an additional set of validations, to determine if the CPL is conforming or not.

Output

The Probe task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfProbeStep.property.subproperty1.subpropertyN

Where:

  • nameOfProbeStep- the name that we give to the Probe task in the Workflow Definition
  • property- a property of the Probe task output
  • subproperty[1-n] - a subproperty, at the Nth level in the output structure

Example: $.Probe.probeProperties.streams.height

  • probeProperties - a raw JSON object containing the probe information that is extracted during this step
  • probeActivityStatus - the status of the internal probe process. Not to be confused with the status of the Probe Task
  • type - the media item type that is determined in Connect based on the probing process
  • size - the size of the media item
  • lastModified - the last update date of the media item
  • etag - the eTag of the media item
  • mediainfoPropertiesRedisKey - the Redis Key of the MediaInfo properties
  • fileExtension - the extension of the media item
  • fileOrigin - the origin of the media item in Connect, it can either be a:
    • source
    • deliverable
    • intermediate
  • fileImfEssenceType - the IMF Essence type of the media item, that is determined in Connect, it can either be null or:
    • audio
    • image
    • immersive audio bitsteam
    • timed text
    • composition playlist
  • fileContainerFormat- the media container format that the media item is in (ie. mov)
  • fileHasStreams- boolean value denoting if the media item has ANY streams
  • fileHasVideoStreams- boolean value denoting if the media item has video streams
  • fileHasAudioStreams- boolean value denoting if the media item has audio streams
  • fileHasStreamWithPHDRDescriptor- boolean value denoting if the media item has streams with PHDRD descriptors
  • fileHasSubtitleStream- boolean value denoting if the media item has timed text streams
  • fileHasMediaInfoTextTrack- boolean value denoting if the media item has a text track when run through MediaInfo
  • status- the status of the probing process
  • fileHasMD5: boolean- boolean value denoting if the media item has a md5 hash
  • fileHasSHA1: boolean- boolean value denoting if the media item has a sha1 hash

Probe Task output examples

Probe Task output payload for an image type media item

Output payload
"ProbeFile": {
"status": "completed",
"probeProperties": {
"width": "1280",
"height": "720",
"bitDepth": "8"
},
"probeActivityStatus": true,
"type": "image",
"size": 23270,
"lastModified": "2023-04-10T11:31:07.000Z",
"etag": "39ea90c9d8aa84c33e619277b19bfda9-1",
"fileExtension": ".jpg",
"fileOrigin": "source",
"fileImfEssenceType": null,
"fileHasStreams": false,
"fileHasAudioStreams": false,
"fileHasStreamWithPHDRDescriptor": false,
"fileHasStreamWithPHDRDescriptor": false,
"fileHasSubtitleStream": false,
"fileHasMediaInfoTextTrack": false,
}

Probe Task output payload for a media_container type media item

Output payload
{
"status": "completed",
"probeProperties": {
"streams": [
{
"index": 0,
"profile": "Main",
"width": 320,
"height": 240,
"level": 13,
"refs": 1,
"id": "0x1",
"duration": "13.666667",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"hearingImpaired": 0,
"visualImpaired": 0,
"cleanEffects": 0,
"attachedPic": 0,
"timedThumbnails": 0,
"stillImage": 0
},
"tags": {
"language": "und",
"creationTime": "1970-01-01T00:00:00.000000Z",
"handlerName": "VideoHandler",
"vendorId": "[0][0][0][0]"
},
"codecName": "h264",
"codecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"codecType": "video",
"codecTagString": "avc1",
"codecTag": "0x31637661",
"codedWidth": 320,
"codedHeight": 240,
"closedCaptions": 0,
"filmGrain": 0,
"hasBFrames": 0,
"sampleAspectRatio": "1:1",
"displayAspectRatio": "4:3",
"pixFmt": "yuv420p",
"chromaLocation": "left",
"fieldOrder": "progressive",
"isAvc": "true",
"nalLengthSize": "4",
"rFrameRate": "15/1",
"avgFrameRate": "15/1",
"timeBase": "1/15360",
"startPts": 0,
"startTime": "0.000000",
"durationTs": 209920,
"bitRate": "229387",
"bitsPerRawSample": "8",
"nbFrames": "205",
"extradataSize": 37
},
{
"index": 1,
"profile": "LC",
"channels": 6,
"id": "0x2",
"duration": "13.696000",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"hearingImpaired": 0,
"visualImpaired": 0,
"cleanEffects": 0,
"attachedPic": 0,
"timedThumbnails": 0,
"stillImage": 0
},
"tags": {
"language": "und",
"creationTime": "1970-01-01T00:00:00.000000Z",
"handlerName": "SoundHandler",
"vendorId": "[0][0][0][0]"
},
"codecName": "aac",
"codecLongName": "AAC (Advanced Audio Coding)",
"codecType": "audio",
"codecTagString": "mp4a",
"codecTag": "0x6134706d",
"sampleFmt": "fltp",
"sampleRate": "48000",
"channelLayout": "5.1",
"bitsPerSample": 0,
"rFrameRate": "0/0",
"avgFrameRate": "0/0",
"timeBase": "1/48000",
"startPts": 0,
"startTime": "0.000000",
"durationTs": 657408,
"bitRate": "382488",
"nbFrames": "642",
"extradataSize": 2
}
],
"format": {
"filename": "http://localhost:4566/oz-zl-test-files/zypline/test/SampleVideo_360x240_1mb.mp4?AWSAccessKeyId=test&Expires=1680722731&Signature=NQQuVk%2FhcaPlz8aVnJhexCh7PPw%3D",
"duration": "13.696000",
"size": "1053651",
"tags": {
"encoder": "Lavf53.24.2",
"majorBrand": "isom",
"minorVersion": "512",
"compatibleBrands": "isomiso2avc1mp41",
"creationTime": "1970-01-01T00:00:00.000000Z"
},
"nbStreams": 2,
"nbPrograms": 0,
"formatName": "mov,mp4,m4a,3gp,3g2,mj2",
"formatLongName": "QuickTime / MOV",
"startTime": "0.000000",
"bitRate": "615450",
"probeScore": 100
}
},
"probeActivityStatus": true,
"type": "media_container",
"size": 1053651,
"lastModified": "2023-04-05T13:25:31.000Z",
"etag": "59b8487da4236b3d42890fedab86ac64",
"mediainfoPropertiesRedisKey": "MediaInfo-JSON-d868d6cc-9031-4c74-ac7e-3018f75514ed"
"fileExtension": ".jpg",
"fileOrigin": "source",
"fileImfEssenceType": null,
"fileHasStreams": false,
"fileHasStreamWithPHDRDescriptor": false,
"fileHasSubtitleStream": false,
"fileHasMediaInfoTextTrack": false,
}

Interlace scan Task

Overview

Checks if a video media item is Interlaced or Progressive, regardless of what is specified in the media item’s technical metadata, and overwrites that value with the scan result.

Input

  • fileId: string - the ID of the media item that we want to run the interlace analysis on.

Constraints

While not restricted, it is recommended that the Interlace scan task be run on media items that:

  • have the MediaContainer type and Source or Deliverable file origin.
  • file.properties should have streams (FFProbeStream).
  • when the file from the input is .mxf, it should have a track on it, that is of the video type
    • the codec value for the track must not be jpeg2000 or aces due to limitations of the ffmpeg version that is currently used by Connect.

Logic

  • Based on fileId, fetches all the persisted file info from the media item that is identified with the ID.
  • Checks if the videoTracks property on the media item is either jpeg2000 or aces, otherwise, the task will skip.
  • The media item properties for interlaceScan (file.properties.interlaceScan) are updated with scanType and scanOrder that result from the Interlace scan task.
  • If the media item has a track of the Video type then the values scanType and scanOrder are also updated for the track itself.

Output

Interlace scan task outputs can be referenced using the following naming convention:

$.nameOfStep.property

Where:

  • nameOfStep - the name that we give to the Interlace scan task in the Workflow Definition
  • property - a property of the Interlace scan task output

Example: $.InterlaceScan.InterlaceScanType

  • InterlaceScanType - this value can be:
    • Interlaced
    • Progressive
    • Unknown
  • InterlaceScanOrder - relevant for Interlaced media items, this value can be:
    • TFF - Top Frame First
    • BFF - Bottom Frame First
    • Unknown

Hash Task

Overview

Generates md5 and sha hashes (file signatures) for the media item and stores them in the Connect database.

It will either rehash a media item from scratch or return an existing hash if the hashState is available in the input.

If fileHasMD5 and fileHasSHA1 are true, the execution will stop since there is no need for a new hash.

Input

  • fileLocator: string - the locator of the file that we want to Hash from S3.
  • hashState? : any - optional input, the hashing state of the media item.
  • fileHasMD5: boolean - Probe Task output, denoting if the media item has a md5 hash.
  • fileHasSHA1: boolean - Probe Task output, denoting if the media item has a sha1 hash.

Output

Hash task outputs can be referenced using the following naming convention:

$.nameOfStep.property

Where:

  • nameOfStep - the name that we give to the Hash task in the Workflow Definition
  • property - a property of the Hash task output

Example: $.Hash.hashState

  • md5: string - the md5 hash of the media item
  • sha1: string - the sha1 hash of the media item

Crop Detection Task

Overview

Calculates the recommended crop area of a video media item (the non-black area) and stores the information at a media item level, without performing a crop action.

Note

mxf deliverables do not support Crop Detection.

Input

  • fileId: string - the ID of the media item that we want to run the crop detection on.

Constraints

While not restricted, it is recommended that the Crop detection task be run on media items that:

  • have the MediaContainer type and Source or Deliverable file origin.
  • file.properties should have streams (FFProbeStream).

Logic

  • If the media item doesn't have any existing crop properties on it, the execution of this task will enter a failure state
  • If the task is successful, the media item properties will be updated with the value from cropRectangles and boundingBox
  • The following process will take place in order to calculate cropRectangles and boundingBox
    • cropRectangles are calculated every 20 frames (as of today the number of frames can not be set as an input) with the ffmpeg cropdetect command
    • Each cropRectangle will have a set of values associated with it:
      • timeOffset - index of the cropRectangle
      • height
      • width
      • xOffset
      • yOffset
    • the boundingBox is calculated at the end by taking:
      • The max value out of all cropRectangles for height and width
      • The min value out of all cropRectangles for xOffset and yOffset

Output

Crop detection task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfStep.property

Where:

  • nameOfStep - the name that we give to the Crop detection task in the Workflow Definition
  • property - a property of the Crop detection task output
  • subproperty[1-n] - a subproperty, at the Nth level in the output structure

Example: $.CropDetection.boundingBox.height

  • cropRectangles - the crop values detected by ffmpeg every 20 frames
  • boundingBox - the recommended crop settings, which are also applied on the Workbench tab of the media item

Crop detection task output example

Example
{
"cropRectangles": [
{
"timeOffset": 0,
"width": 720,
"height": 480,
"xOffset": 0,
"yOffset": 4
},
{
"timeOffset": 1,
"width": 720,
"height": 480,
"xOffset": 0,
"yOffset": 4
},
{
"timeOffset": 2,
"width": 720,
"height": 480,
"xOffset": 0,
"yOffset": 4
},
{
"timeOffset": 3,
"width": 720,
"height": 480,
"xOffset": 0,
"yOffset": 4
},
{
"timeOffset": 4,
"width": 720,
"height": 480,
"xOffset": 0,
"yOffset": 4
}
],
"boundingBox": {
"xOffset": 0,
"yOffset": 4,
"width": 720,
"height": 480
}
}

Extract timed text Task

Overview

Detects embedded timed text in the media item and extracts the timed text tracks as separate media items. Uses NodeTT service to perform this action.

Input

  • fileId: string - the ID of the media item that we want to extract timed text from.

Constraints

While not restricted, it is recommended that the Extract timed text task be run on media items that:

  • have at least one stream with the subtitle type OR
  • have a mediaInfo property (media.track) of the Text type

If you don't follow the recommendation, the task execution will fail or will behave unexpectedly.

Output

Extract timed text task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfStep.property.subproperty1.subpropertyN

Where:

  • nameOfProbeStep - the name that we give to the Probe task in the Workflow Definition
  • property - a property of the Probe task output
  • subproperty[1-n] - a subproperty, at the Nth level in the output structure

Example: $.ExtractTT.outputFileLocators[0]

  • outputFileLocatorUrls: string[] - an array of locator URLs of the extracted timed text media items
  • timedTextExtractLocationUrl: string - the S3 locators where the timed text will be extracted

Convert timed text Task

Overview

Converts a timed text media item to a specified format. Calculates the frameRate, editRate, timeCode of a video or timed text media item. Uses NodeTT service to perform this action.

Input

  • fileId: string - the ID of the media item that we want to convert timed text from.
  • timedTextExtractLocator : string - Extract Timed Text task output, the file locator of the extracted timed text.

Constraints

While not restricted, it is recommended that the Extract timed text task should be run on media items that:

  • have either fileHasSubtitleStream or fileHasMediaInfoTextTrack as true.

The task also depends on the Extract Timed Text Task, because it uses its output file locators to be passed as inputs. In the contrary case, the task execution will fail or will behave unexpectedly.

Output

Probe task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfProbeStep.property.subproperty1.subpropertyN

Where:

  • nameOfProbeStep - the name that we give to the Probe task in the Workflow Definition
  • property - a property of the Probe task output
  • subproperty[1-n] - a subproperty, at the Nth level in the output structure

Example: $.ConvertTT.outputFileLocatorUrl

  • nodeTTConvertTimedTextResponse: ITimedTextConvert - the timed text convert response of the Node TT service.
  • outputFileLocator: string - the file locator of the resulting converted timed text media item.

Inspect timed text Task

Overview

Inspects a media item and creates/updates the Timed Text Track associated with that media item.

Input

  • fileId: string - the ID of the media item that we want to inspect timed text from.

Constraints

While not restricted, it is recommended that the Extract timed text task be run on media items that:

  • are of the caption type OR
  • that have the IMF Essence Type as imf_timed_text_essence (ImfTimedTextEssence) OR
  • have either fileHasSubtitleStream or fileHasMediaInfoTextTrack as true

If you don't follow the recommendation, the task execution will fail or will behave unexpectedly.

Workflow definition Choice step example

Example
ChooseFileTypeOrFileImfEssenceType:
Type: Choice
Choices:
- Variable: $.EnsureAccess.fileId
Operator: IsPresent
Value: false
Next: Failed
- Variable: $.ProbeFile.type
Operator: StringEquals
Value: "caption"
Next: InspectTimedText
- Variable: $.ProbeFile.fileImfEssenceType
Operator: IsPresent
Value: false
Next: Failed
- Variable: $.ProbeFile.fileImfEssenceType
Operator: StringEquals
Value: "imf_timed_text_essence"
Next: InspectTimedText
Default: Failed

Logic

When a file does not have tracks on it fileHasTracks = false, then the Inspect Timed Text task will create a new track entity associated with the media item from the input.

Additionally, it will create a new TimedTextTrack for the newly created track. The link between the two of them is made through the field id. TimedTextTrack.id === the Track.id

Output

Inspect Timed Text task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfProbeStep.property.subproperty1.subpropertyN

Where:

  • nameOfProbeStep - the name that we give to the Inspect Timed Text task in the Workflow Definition
  • property - a property of the Inspect Timed Text Task output
  • subproperty[1-n] - a subproperty, at the Nth level in the output structure

Example: $.InspectTT.probeProperties.streams.height

  • fileHasTracks - indicates if the file from the input has tracks on it. (Video, Audio, Data, TimedText, Dv, Iab)
  • updatedTimedTextTrackId - the id of the timed text track updated by Inspect Timed Text task with the results of node-tt inspection.

Media View Cache Builder Task

Overview

Caches media streams (audio, video, image sequence) on certain files that contain such streams, like IMF, MXF, CPL.

Input

  • fileId: string - the ID of the media item that we want to cache.

Constraints

While not restricted, it is recommended that the _Extract timed text _task should be run on media items that:

  • are of the mediaContainer type and are marked as source or deliverable

When using the Generate preview cache Task as part of your workflows, you can use the boolean fields output by the Probe task like fileHasAudioStreams, fileHasVideoStreams to check if the file analyzed by the workflow contains streams that can be cached. This check can speed up the workflow execution for files that don't contain any usable stream.

Output

This task has no output values that can be referenced.

Frame scan Task

Overview

Performs a scan of a media item’s frames, in order to determine if the video was converted from one frame rate to another using 3:2 pulldown or 4th frame repeat.

Input

  • fileId: string - the ID of the media item that we want to run the frame scan on.

Constraints

While not restricted, it is recommended that the Frame scan task be run on media items that:

  • have the MediaContainer type and Source or Deliverable file origin
  • due to the current version of ffmpeg that Connect is using, the media item must not be of the .mxf type
  • file.properties should have streams (FFProbeStream) and at least one stream should have a video-type codec.

Output

Frame scan task outputs can be referenced using the following naming convention:

$.nameOfStep.property

Where:

  • nameOfStep - the name that we give to the Frame scan task in the Workflow Definition
  • property - a property of the Frame scan task output

Example: $.FrameScan.scanType

  • frameScan - the analysis result of the Frame Scan process, can be one of the following:
    • Pulldown - 3:2 pulldown
    • Repeat - 4th frame repeat
    • Unknown

Extract Dolby Vision Metadata Task

Overview

Extract Dolby Vision Metadata from a media item in a separate .XML.

Input

  • fileId: string - the ID of the media item that we want to extract Dolby Vision metadata from

Constraints

Extract Dolby vision metadata Task will run in a Workflow for media items that respect both conditions:

  • media item has IMF Essence Type = imf_image_essence
  • media item has streams that have PhdrDescriptor

These properties should be used in the Workflow Definition as a condition before running this task.

The user can access these fields by using the Probe Task outputs:

  • $.ProbeFile.fileHasStreamWithPHDRDescriptor
  • $.ProbeFile.fileImfEssenceType

Logic

The task creates a new media item based on the media item used as input via fileId. The new media item uses .xml as an extension and a unique name is generated for it using the uuid v4 algorithm.

The new media item is assigned as a child of the input file.

The task uses the Queue (RRTQ) named dovi-extractor from the namespace media-warp-dovi-extractor.

The dovi-extractor library is used to extract information in the new media item, alongside other information.

Output

Extract Dolby Vision Metadata Task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfStep.property

Where:

  • nameOfStep - the name that we give to the Extract Dolby Vision Metadata task in the Workflow Definition
  • property - a property of the Extract Dolby Vision Metadata task output
  • subproperty[1-n] - a subproperty, at the Nth level in the output structure

Example: $.ExtractDV.firstFrame

  • url: string - the crop values detected by ffmpeg every 20 frames
  • metafierOutput?: any - the error output of the metafier --validate command, if this command throws an error
  • firstFrame: number - the starting frame number
  • duration: number - the difference between the end frame and the first frame (range.end - range.start)

Baton Task

Overview

Performs quality control checks on files using the Baton QC provider and generates a PDF report that is registered in Connect.

The analysis is limited to media items that are of the media_container type and have the source origin.

Constraints

Probe output variables should be used in choices in order to validate the media item before running a Baton task.

Video and Audio streams can be used as constraints from the Probe task output.

A YAML definition example for how the Baton Task should be used alongside a Choice component:

YAML definition example
CheckFileOrigin:`
Type: Choice
Choices:
- Variable: $.Probe.fileOrigin
Operator: StringEquals
Value: "source"
Next: CheckFileType
Default: Failed
CheckFileType:
Type: Choice
Choices:
- Variable: $.Probe.type
Operator: StringEquals
Value: "media_container"
Next: CheckVideoStream
Default: Failed
CheckVideoStream:
Type: Choice
Choices:
- Variable: $.Probe.fileHasVideoStreams
Operator: BooleanEquals
Value: true
Next: CheckAudioStream
Default: Failed
CheckAudioStream:
Type: Choice
Choices:
- Variable: $.Probe.fileHasAudioStreams
Operator: BooleanEquals
Value: true
Next: Baton
Default: Failed

Input

  • fileId: string - the ID of the media item that we want to run Baton QC on.
  • qcProfileId: string - the Connect ID of the Baton QC profile, this can be obtained by accessing the Baton QC profile in the user interface.

Output

Baton Task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfStep.property

Where:

  • nameOfStep - the name that we give to the Baton task in the Workflow Definition
  • property - a property of the Baton task output

Example: $.Baton.errorsNo

  • reportFileId: string - the ID of the Baton report that is generated and registered within the Connect DB
  • reportFileLocatorUrl: string - the file locator of the Baton report that is generated and registered within the Connect DB
  • info: string - a summary of the QC process (for example, File has 1 errors, 0 warnings)
  • errorsNo: number - the number of errors in the report
  • warningsNo: number - the number of warnings in the report
  • batonJobStatus: BatonJobStatus - the status of the Baton QC Job, generated by Baton
  • jobId: sting - the ID of the Baton QC job, generated by Baton

Generate Thumbnail Task

Overview

Performs thumbnail extraction on the media item identified by its fileId passed as input.

Two thumbnails are generated: a large one and a small one, 256 and 64 px maximum height or width. These values depend on the media item’s aspect ratio.

For video media items, the thumbnail extraction algorithm avoids the extraction of black frames by default, except for videos made entirely of black frames.

The thumbnails are generated in the Artifacts folder that has been specified in the Storage settings.

Constraints

For the Ingest Workflow, certain conditions must be considered for the task to run properly:

  • The media item must be of type MediaContainer or Image.
  • It is recommended, although not mandatory, to run Probe on the media item in the workflow beforehand, to access information around duration (where applicable) and aspect ratio. If there is no duration information available at the moment that this Task is running, then a frame will be selected from the first 10 minutes of the video media item.

Input

  • fileId: string - the ID of the media item that we want to generate a thumbnail for.

Output

Generate Thumbnail task outputs can be referenced in workflows (for example in a Choice condition) using the following naming convention:

$.nameOfStep.property

Where:

  • nameOfStep - the name that we give to the Baton task in the Workflow Definition
  • property - a property of the Baton task output

Example: $.GenerateThumbnail.locators

  • locators: FileLocator[] - an array which contains the file locators of the generated thumbnails
  • message?: string - optional, can contain a warning message if the workflow is attempting to generate thumbnails for an invalid media item type (ie. XML or audio)

JSON Output Example for valid media type

JSON output example
{
"locators": [
{
"type": "S3FileLocator",
"managedUpload": {},
"key": "connect/connect-artifacts/05bf6510-f77a-4cb8-ab7d-4d4eba5dc765/thumbnails/movie_thumb_64.jpg",
"s3AccessKeyId": "",
"s3SecretAccessKey": "",
"s3Endpoint": "",
"s3ConfigExtraArgs": {},
"bucketName": "test-bucket"
},
{
"type": "S3FileLocator",
"managedUpload": {},
"key": "connect/connect-artifacts/05bf6510-f77a-4cb8-ab7d-4d4eba5dc765/thumbnails/movie_thumb_256.jpg",
"s3AccessKeyId": "",
"s3SecretAccessKey": "",
"s3Endpoint": "",
"s3ConfigExtraArgs": {},
"bucketName": "test-bucket"
}
]
}

JSON Output Example for invalid media type

JSON output example
{
"locators": [],
"message": "Thumbnails not generated. Invalid media type."
}
Creating a workflow definition using the code editorTriggers