Skip to content

AWS.MediaConvert reference

Source: src/AWS/MediaConvert/CancelJob.ts

Runtime binding for mediaconvert:CancelJob — permanently cancel a submitted transcode job that has not finished (canceled jobs cannot be restarted).

Job ids are server-assigned at runtime, so the binding takes no arguments and grants mediaconvert:CancelJob on *. Provide the implementation with Effect.provide(AWS.MediaConvert.CancelJobHttp).

// init
const cancelJob = yield* AWS.MediaConvert.CancelJob();
// runtime
yield* cancelJob({ Id: jobId }).pipe(
// already finished / already gone — nothing to cancel
Effect.catchTag(["NotFoundException", "ConflictException"], () => Effect.void),
);

Source: src/AWS/MediaConvert/CreateJob.ts

Runtime binding for mediaconvert:CreateJob — submit a transcode job from runtime code, the classic “S3 upload event → Lambda → transcode” workflow. Also grants iam:PassRole (conditioned to mediaconvert.amazonaws.com) for the S3-access role the job passes to the service.

Job ids are server-assigned at runtime, so the binding takes no arguments and grants mediaconvert:CreateJob on *. Provide the implementation with Effect.provide(AWS.MediaConvert.CreateJobHttp).

// init
const createJob = yield* AWS.MediaConvert.CreateJob();
// runtime
const { Job } = yield* createJob({
Role: roleArn,
JobTemplate: template.jobTemplateName,
Settings: { Inputs: [{ FileInput: `s3://${bucket}/${key}` }] },
});

Source: src/AWS/MediaConvert/GetJob.ts

Runtime binding for mediaconvert:GetJob — poll the status and full JSON of a submitted transcode job from runtime code.

Job ids are server-assigned at runtime, so the binding takes no arguments and grants mediaconvert:GetJob on *. Provide the implementation with Effect.provide(AWS.MediaConvert.GetJobHttp).

// init
const getJob = yield* AWS.MediaConvert.GetJob();
// runtime
const { Job } = yield* getJob({ Id: jobId });
if (Job?.Status === "COMPLETE") { ... }

Source: src/AWS/MediaConvert/GetJobsQueryResults.ts

Runtime binding for mediaconvert:GetJobsQueryResults — fetch the results of an asynchronous jobs query started with StartJobsQuery.

The binding takes no arguments and grants mediaconvert:GetJobsQueryResults on *. Provide the implementation with Effect.provide(AWS.MediaConvert.GetJobsQueryResultsHttp).

// init
const getJobsQueryResults = yield* AWS.MediaConvert.GetJobsQueryResults();
// runtime
const results = yield* getJobsQueryResults({ Id: queryId });
if (results.Status === "COMPLETE") {
const jobs = results.Jobs ?? [];
}

Source: src/AWS/MediaConvert/Job.ts

An AWS Elemental MediaConvert transcode job — a one-shot request to convert an input in S3 into one or more outputs. Jobs are immutable once submitted: they run to COMPLETE, ERROR, or CANCELED on their own. Deleting the resource cancels the job only if it is still SUBMITTED or PROGRESSING.

A live job is slow and billable — it requires input/output S3 objects and an IAM role MediaConvert can assume. Drive it behind an environment gate in tests rather than on every run.

const job = yield* MediaConvert.Job("Transcode", {
role: mediaConvertRole.roleArn,
jobTemplate: template.jobTemplateName,
settings: {
Inputs: [{ FileInput: "s3://my-bucket/input.mp4" }],
OutputGroups: [
{
OutputGroupSettings: {
Type: "FILE_GROUP_SETTINGS",
FileGroupSettings: { Destination: "s3://my-bucket/out/" },
},
Outputs: [{ Preset: preset.presetName }],
},
],
},
});

Source: src/AWS/MediaConvert/JobTemplate.ts

An AWS Elemental MediaConvert job template — a reusable, named transcode configuration (inputs, output groups, and job-level settings) that new jobs are created from so callers only supply the input/output specifics.

const template = yield* MediaConvert.JobTemplate("Mp4", {
description: "Single MP4 output",
settings: {
Inputs: [{ TimecodeSource: "ZEROBASED" }],
OutputGroups: [
{
OutputGroupSettings: {
Type: "FILE_GROUP_SETTINGS",
FileGroupSettings: {},
},
Outputs: [
{
ContainerSettings: { Container: "MP4" },
VideoDescription: {
CodecSettings: {
Codec: "H_264",
H264Settings: {
RateControlMode: "QVBR",
MaxBitrate: 5000000,
},
},
},
},
],
},
],
},
});

Source: src/AWS/MediaConvert/ListJobs.ts

Runtime binding for mediaconvert:ListJobs — list your most recent transcode jobs from runtime code, optionally filtered by queue or status.

The binding takes no arguments and grants mediaconvert:ListJobs on *. Provide the implementation with Effect.provide(AWS.MediaConvert.ListJobsHttp).

// init
const listJobs = yield* AWS.MediaConvert.ListJobs();
// runtime
const { Jobs } = yield* listJobs({ Status: "PROGRESSING" });

Source: src/AWS/MediaConvert/Preset.ts

An AWS Elemental MediaConvert output preset — a reusable, named bundle of output settings (container, video codec/resolution/bitrate, audio, and captions) that job templates and jobs reference to produce one output.

const preset = yield* MediaConvert.Preset("Mp4", {
description: "1080p H.264 MP4",
settings: {
ContainerSettings: { Container: "MP4" },
VideoDescription: {
Width: 1920,
Height: 1080,
CodecSettings: {
Codec: "H_264",
H264Settings: { RateControlMode: "QVBR", MaxBitrate: 5000000 },
},
},
AudioDescriptions: [
{
CodecSettings: {
Codec: "AAC",
AacSettings: {
Bitrate: 96000,
CodingMode: "CODING_MODE_2_0",
SampleRate: 48000,
},
},
},
],
},
});

Source: src/AWS/MediaConvert/Probe.ts

Runtime binding for mediaconvert:Probe — analyze an input media file in S3 (or over HTTPS) and get back its container, codecs, frame rate, resolution, track layout, and captions, to drive transcoding decisions at runtime.

The binding takes no arguments and grants mediaconvert:Probe on *. Note the probing itself reads the file with the caller’s credentials — the Function also needs S3 read access to the probed object (bind an AWS.S3.GetObject capability on the bucket). Provide the implementation with Effect.provide(AWS.MediaConvert.ProbeHttp).

// init
const probe = yield* AWS.MediaConvert.Probe();
// runtime
const { ProbeResults } = yield* probe({
InputFiles: [{ FileUrl: `s3://${bucket}/${key}` }],
});
const video = ProbeResults?.[0]?.TrackMappings;

Source: src/AWS/MediaConvert/Queue.ts

An AWS Elemental MediaConvert queue — the pool that submitted transcode jobs are scheduled against. Every account has a system Default on-demand queue; create additional queues to isolate workloads or to purchase reserved render capacity.

On-Demand Queue

const queue = yield* MediaConvert.Queue("Transcode", {
description: "Marketing video transcodes",
});

Paused Queue

const queue = yield* MediaConvert.Queue("Transcode", {
status: "PAUSED",
tags: { team: "media" },
});
const queue = yield* MediaConvert.Queue("Reserved", {
pricingPlan: "RESERVED",
reservationPlanSettings: {
Commitment: "ONE_YEAR",
RenewalType: "EXPIRE",
ReservedSlots: 1,
},
});

Source: src/AWS/MediaConvert/SearchJobs.ts

Runtime binding for mediaconvert:SearchJobs — search your recent transcode jobs by input file, queue, or status from runtime code (e.g. “did we already transcode this upload?”).

The binding takes no arguments and grants mediaconvert:SearchJobs on *. Provide the implementation with Effect.provide(AWS.MediaConvert.SearchJobsHttp).

// init
const searchJobs = yield* AWS.MediaConvert.SearchJobs();
// runtime
const { Jobs } = yield* searchJobs({
InputFile: `s3://${bucket}/${key}`,
Status: "COMPLETE",
});

Source: src/AWS/MediaConvert/StartJobsQuery.ts

Runtime binding for mediaconvert:StartJobsQuery — start an asynchronous, filtered query over your job history (the async counterpart of SearchJobs for larger result sets). Retrieve the results with GetJobsQueryResults using the returned query Id.

The binding takes no arguments and grants mediaconvert:StartJobsQuery on *. Provide the implementation with Effect.provide(AWS.MediaConvert.StartJobsQueryHttp).

// init
const startJobsQuery = yield* AWS.MediaConvert.StartJobsQuery();
// runtime
const { Id } = yield* startJobsQuery({
FilterList: [{ Type: "STATUS", Inputs: ["ERROR"] }],
});