Skip to content

GCP.Transcoder reference

Source: src/GCP/Transcoder/CreateJob.ts

Runtime binding for Transcoder jobs.create.

Starts a transcoding job in the template’s location. When body.config is omitted, templateId is filled from the bound JobTemplate. Provide CreateJobHttp.

Grants roles/transcoder.editor on the project because Transcoder has no resource-level IAM and no narrower predefined role carries transcoder.jobs.create (roles/transcoder.viewer is read-only).

const createJob = yield* GCP.Transcoder.CreateJob(template);
const job = yield* createJob({
body: {
inputUri: "gs://bucket/inputs/file.mp4",
outputUri: "gs://bucket/outputs/",
},
});

Source: src/GCP/Transcoder/CreateJobHttp.ts Kind: Layer · Provides: GCP.Transcoder.CreateJob

HTTP implementation of CreateJob.

Source: src/GCP/Transcoder/JobTemplate.ts

A Transcoder API job template. Templates capture a reusable JobConfig so jobs can be created with templateId instead of repeating elementary/mux stream settings.

The API exposes create, get, list, and delete only — there is no patch. Changing jobTemplateId, location, config, or labels replaces the template. Ownership is stamped with Alchemy labels so list / nuke can find it.

Generated id

const template = yield* GCP.Transcoder.JobTemplate("WebHd", {
config: {
elementaryStreams: [
{
key: "video-stream0",
videoStream: {
h264: {
heightPixels: 360,
widthPixels: 640,
bitrateBps: 550000,
frameRate: 30,
},
},
},
{
key: "audio-stream0",
audioStream: { codec: "aac", bitrateBps: 64000 },
},
],
muxStreams: [
{
key: "sd",
container: "mp4",
elementaryStreams: ["video-stream0", "audio-stream0"],
},
],
},
});

Explicit id and labels

const template = yield* GCP.Transcoder.JobTemplate("WebHd", {
jobTemplateId: "web-sd",
location: "us-central1",
labels: { env: "prod" },
config: {
elementaryStreams: [
{
key: "video-stream0",
videoStream: {
h264: { bitrateBps: 550000, frameRate: 30 },
},
},
],
muxStreams: [
{
key: "sd",
container: "mp4",
elementaryStreams: ["video-stream0"],
},
],
},
});

JobTemplate: Creating a Job from a Template

Section titled “JobTemplate: Creating a Job from a Template”
const createJob = yield* GCP.Transcoder.CreateJob(template);
const job = yield* createJob({
body: {
inputUri: "gs://bucket/inputs/file.mp4",
outputUri: "gs://bucket/outputs/",
},
});