AWS Elastic Transcoder Connector

This connector can be used to transcode video and audio using Amazon's transcoder service. Full information about the Amazon Elastic Transcoder service API can be found here.

All actions throw in case of an error.

Events:

JobStatusChanged Transcoding job status changed

Actions:

cancelJob Cancel a transcoding job

createJob Start a transcoding job

findPipelineByName Find pipeline by name

findPresetByDescription Find preset by description

listPipelines Get a list of all transcoding pipelines

listPresets Get a list of all format presets

readJob Get information about a transcoding job

SDK:

sdk Get direct SDK access

Event Details

Job Status Changed event

Example:

public handler(event) {
  console.log(`Job ${event.jobId}: ${
    event.old.Status} -> ${event.current.Status}`)
}

This event is fired when the status of a transcoding job changes.

Job status can be one of Submitted, Progressing, Complete, Canceled, or Error.

Action Details

Cancel Job action

Definition:

(
  id: string,
) => void

Usage:

const job = await AmazonElasticTranscoderConnector.createJob(...)
await AmazonElasticTranscoderConnector.cancelJob(job.Id)

Cancel a transcoding job.

Create Job action

Definition:

(
  params: object,
) => object

Usage:

const job = await AmazonElasticTranscoderConnector.createJob({
  PipelineId: '3141592653589-pipipe',
  Input: {
    Key: 'my-input-file.mov',
  },
  Output: {
    PresetId: '2718281828459-045235',
    Key: 'my-output-file.mp4',
    Rotate: '180',
  },
})

This action start a new transcoding job using the specified pipeline. The full set of parameters for creating a new job is described here.

Find Pipeline By Name action

Definition:

(
  token: string,
) => object

Usage:

const pipeline = await AmazonElasticTranscoderConnector.findPipelineByName(
  'My Pipeline'
)

Find a pipeline whose name matches the specified token. Matching is performed according to different criteria in this order of preference:

  • Exact match
  • Exact case-insensitive match
  • Name starts with token
  • Token included in name

If no match is found, this action throws an Error.

Find Preset By Description action

Definition:

(
  token: string,
) => object

Usage:

const preset = await AmazonElasticTranscoderConnector.findPresetByDescription('iphone')

Find a preset object with a description matching the specified token. Matching is performed according to different criteria in this order of preference:

  • Exact match
  • Exact case-insensitive match
  • Description starts with token
  • Token included in description

If no match is found, this action throws an Error.

List Pipelines action

Definition:

() => object[]

Usage:

const pipelines = await AmazonElasticTranscoderConnector.listPipelines()

List all the available transcoding pipelines. Pipelines define the S3 buckets for input and output video files, as well as encryption and other storage related parameters, as described here.

At this time, this connector does not support creation and modification of pipelines. Pipelines can be created through the AWS console or the CLI.

List Presets action

Definition:

() => object[]

Usage:

const presets = await AmazonElasticTranscoderConnector.listPresets()

Get a list of transcoding output presets.

Read Job action

Definition:

(
  id: string,
) => object

Usage:

const job = await AmazonElasticTranscoderConnector.createJob(...)
await Script.sleep(1000)
const info = await AmazonElasticTranscoderConnector.readJob(job.Id)

Get updated information on a transcoding job.

SDK Details

SDK action

Definition:

(
  options ?: object,
) => object

Usage:

const s3 = await S3.sdk()

Get the underlying SDK object. You can specify additional options to override or add to the required fields in the connector's configuration.