Skip to content

Simple video transcoder built in Typescript to trim, merge and upload videos to S3 and Vimeo

Notifications You must be signed in to change notification settings

micohasanen/enchant-transcode

Repository files navigation

Video Toolkit for Typescript

Toolkit to get you started on your Typescript video backend.

✅ Trim ✅ Merge ✅ Add overlays ✅ Upload to S3 ✅ Upload to Vimeo ✅ Upload to Cloudflare Stream ✅ Job status

Get Started

Install packages

npm install

Create a .env file and add your config

S3 will work with any S3 compatible storage, not just S3.

REDIS_URL=redis://:@localhost:6379
S3_ENDPOINT=https://s3.eu-central-1.amazonaws.com
S3_REGION=eu-central-1
S3_KEY=my-s3-key
S3_SECRET=my-s3-secret
S3_LOCATION=https://thisismyloc.s3.eu-central-1.amazonaws.com
S3_BUCKET=my-bucket
VIMEO_CLIENT_ID=my-vimeo-client
VIMEO_CLIENT_SECRET=my-vimeo-secret
VIMEO_AUTH_TOKEN=my-auth-token
CF_API_TOKEN=cloudflare-api-token
CF_ACCOUNT_ID=cloudflare-account-id
npm run dev

Make a POST request to / to begin a job, check shape from interfaces/TranscodeJob.ts

interface Video {
  url: string;
  startTime: number;
  endTime: number;
}

interface UploadDest {
  s3?: boolean;
  vimeo?: boolean;
  cloudflare?: boolean;
}

interface TranscodeJob {
  videos: Array<Video>;
  name?: string;
  overlays?: Array<Overlay>;
  screenshots?: boolean;
  ssCount?: number;
  upload: UploadDest;
  webhookUrl?: string;
}

Endpoint will return an id for the job which you can use to query for the job status

Check Job Status

Make a GET request to /:id to check job status

Example response

{
  "id": "job-id",
  "status": "trimming",
  "progress": 10.75,
  "trimIndex": 1
}

License

GNU AGPLv3

About

Simple video transcoder built in Typescript to trim, merge and upload videos to S3 and Vimeo

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published