Overview
A transcoder watches a bucket folder and converts every file that arrives: MP4 in several sizes, HLS for streaming, WebM, MP3 and thumbnails.
When to use it
- Uploaded videos that must play everywhere.
- Thumbnails for every video.
- Recordings to MP3.
How it works
- FFmpeg 8
- Each conversion is a container from a pinned FFmpeg image, with no network.
- Presets
- mp4-480p, mp4-720p, mp4-1080p, webm-720p, hls-720p, mp3, thumbnail.
The input folder is listed every 10 seconds; each new file gets a run. The file is streamed into the container and the results streamed back into the output folder, never through a shared disk.
Architecture
- uploads/incoming/ to Watcher: new file
- Watcher to FFmpeg run: stream in
- FFmpeg run to uploads/ready/: stream out
Flows
A new video
- A user uploads a video to the input folder.
- The watcher starts a run.
- The presets are written to the output folder; the Runs tab shows how long it took.
Set it up
In the console
- Open Transcoders and choose New transcoder.
- Choose the input and output folders and the presets.
- Upload a file to try it.
With the CLI
enclave transcoder create videos --input uploads/incoming/ --output uploads/ready/ --preset mp4-720p --preset thumbnail --waitWith OpenTofu
OpenTofu configuration
resource "enclave_transcoder" "videos" {
name = "videos"
input = { bucket = "uploads", prefix = "incoming/" }
output = { bucket = "uploads", prefix = "ready/" }
presets = ["mp4-720p", "thumbnail"]
}Settings reference
Every setting and output of the OpenTofu resource; the console and the CLI use the same names in their own words. Generated from platform 4d30582.
| Name | Type | Use | What it does |
|---|---|---|---|
input | list of objects | required | Where media arrives. |
name | text | required | Name of the transcoder: 3–40 lowercase letters, digits or hyphens, starting with a letter. Changing it replaces the transcoder. |
output | list of objects | required | Where results go (default prefix "transcoded/"). |
presets | list of text | required | Presets: [mp4-480p mp4-720p mp4-1080p webm-720p hls-720p mp3 thumbnail] |
concurrency | number | optional | Files converted at once, 1–4 (default 1). |
memory_mib | number | optional | Memory per file in MiB, 256–8192 (default 1024). |
project | text | optional | The project to create it in. Defaults to the provider's project (ENCLAVE_PROJECT, else default). Changing it replaces the resource. |
timeout_seconds | number | optional | Longest one file may take, 60–86400 (default 3600). |
watch | true or false | optional | Convert new files automatically (default true). |
id | text | output | Resource ID. |
Limits and security
Good to know
- 1 – 4 files at once; each may take up to its timeout (1 hour by default).
Security
- Runs have no network: they only see the file they were given.