AWS.MediaConvert reference
CancelJob
Section titled “CancelJob”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).
CancelJob: Tracking Jobs
Section titled “CancelJob: Tracking Jobs”// initconst cancelJob = yield* AWS.MediaConvert.CancelJob();
// runtimeyield* cancelJob({ Id: jobId }).pipe( // already finished / already gone — nothing to cancel Effect.catchTag(["NotFoundException", "ConflictException"], () => Effect.void),);CreateJob
Section titled “CreateJob”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).
CreateJob: Submitting Jobs
Section titled “CreateJob: Submitting Jobs”// initconst createJob = yield* AWS.MediaConvert.CreateJob();
// runtimeconst { Job } = yield* createJob({ Role: roleArn, JobTemplate: template.jobTemplateName, Settings: { Inputs: [{ FileInput: `s3://${bucket}/${key}` }] },});GetJob
Section titled “GetJob”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).
GetJob: Tracking Jobs
Section titled “GetJob: Tracking Jobs”// initconst getJob = yield* AWS.MediaConvert.GetJob();
// runtimeconst { Job } = yield* getJob({ Id: jobId });if (Job?.Status === "COMPLETE") { ... }GetJobsQueryResults
Section titled “GetJobsQueryResults”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).
GetJobsQueryResults: Tracking Jobs
Section titled “GetJobsQueryResults: Tracking Jobs”// initconst getJobsQueryResults = yield* AWS.MediaConvert.GetJobsQueryResults();
// runtimeconst 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.
Job: Submitting a Job
Section titled “Job: Submitting a Job”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 }], }, ], },});JobTemplate
Section titled “JobTemplate”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.
JobTemplate: Creating a Job Template
Section titled “JobTemplate: Creating a Job Template”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, }, }, }, }, ], }, ], },});ListJobs
Section titled “ListJobs”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).
ListJobs: Tracking Jobs
Section titled “ListJobs: Tracking Jobs”// initconst listJobs = yield* AWS.MediaConvert.ListJobs();
// runtimeconst { Jobs } = yield* listJobs({ Status: "PROGRESSING" });Preset
Section titled “Preset”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.
Preset: Creating a Preset
Section titled “Preset: Creating a Preset”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).
Probe: Inspecting Inputs
Section titled “Probe: Inspecting Inputs”// initconst probe = yield* AWS.MediaConvert.Probe();
// runtimeconst { 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.
Queue: Creating a Queue
Section titled “Queue: Creating a Queue”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" },});Queue: Reserved Capacity
Section titled “Queue: Reserved Capacity”const queue = yield* MediaConvert.Queue("Reserved", { pricingPlan: "RESERVED", reservationPlanSettings: { Commitment: "ONE_YEAR", RenewalType: "EXPIRE", ReservedSlots: 1, },});SearchJobs
Section titled “SearchJobs”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).
SearchJobs: Tracking Jobs
Section titled “SearchJobs: Tracking Jobs”// initconst searchJobs = yield* AWS.MediaConvert.SearchJobs();
// runtimeconst { Jobs } = yield* searchJobs({ InputFile: `s3://${bucket}/${key}`, Status: "COMPLETE",});StartJobsQuery
Section titled “StartJobsQuery”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).
StartJobsQuery: Tracking Jobs
Section titled “StartJobsQuery: Tracking Jobs”// initconst startJobsQuery = yield* AWS.MediaConvert.StartJobsQuery();
// runtimeconst { Id } = yield* startJobsQuery({ FilterList: [{ Type: "STATUS", Inputs: ["ERROR"] }],});