Watch folders
Drop a file in a folder and get an encode back. The mechanism is simple; the failure modes are worth understanding before you point one at real work.
A watch folder removes the operator from the loop. For a single editor it turns a repeated chore into a drop. For a facility it is how ingest happens at all — nobody types paths for two hundred deliveries a day.
What a watch folder does#
The master watches a directory. When a file appears that matches a rule you configured, a job is submitted for it automatically, using the preset the rule names and writing to the location the rule specifies.
Everything else behaves like a job you submitted by hand — the same chunking, the same distribution across your fleet, the same verification before it is called complete. A watch folder is an automated way to submit, not a separate pipeline.
What a rule is#
Each rule ties four things together.
| Part | What it does |
|---|---|
| Folder | The directory being watched. The master must be able to read it. |
| Pattern | A glob deciding which files qualify — *.mov, *.mp4, or * for everything. |
| What to produce | The deliverables generated from each matching file. |
| Active | Whether the rule is running. Rules are switched off rather than deleted, so you keep the configuration. |
Each rule is scoped to a project, so a facility can run several watch folders with different treatments without them interfering. A single user can ignore this and use one.
The half-copied file problem#
This is the failure that matters, and every watch-folder system has to answer it: a file appears in the directory the moment a copy starts, not when it finishes. Encode it immediately and you encode a fragment.
Two defences run by default.
Files carrying an extension that transfer tools use for in-progress work are skipped outright. A partial file with a temporary extension is never a candidate.
A file whose size is still changing is not ready. The watcher waits for it to stop growing before treating it as complete.
A slow or stalled network copy can pause long enough to look finished. If your sources arrive over a link that stutters, do not rely on this alone — use a sentinel.
Taking control with a sentinel#
If you would rather state explicitly that a file is ready than have the system infer it, drop a marker alongside it. The watcher treats the marker as authoritative and skips the size check.
This is the right answer whenever something upstream knows when a transfer completed — a delivery script, a render manager, an ingest tool. Copy the media, then write the marker. Nothing is picked up until you say so.
Inference is convenient for a person dragging files. Automation should not guess: if a system is producing the files, have it signal completion rather than leaving the watcher to work it out.
Naming the output#
Output paths are built from a small template language. Four substitutions are available:
| Placeholder | Becomes |
|---|---|
{filename} | The full source filename — documentary.mov |
{basename} | The stem only — documentary |
{date} | UTC date as YYYY-MM-DD |
{preset_name} | The preset slug — youtube-1080p-h264 |
The language is deliberately tiny. An unknown placeholder is rejected with a message naming it, rather than producing a path with a literal brace in it that you discover a week later.
A template using only {basename} writes two files with the same stem to the same place. If a folder can receive take01.mov and take01.mxf, include {preset_name} or {filename} so the outputs stay distinct.
Things to get right first#
- Test with one file. A rule that is subtly wrong is wrong for every file that lands. Drop one, confirm the output, then open the gate.
- Do not watch a folder you also write outputs into. The output matches the pattern, gets picked up, and encodes again. Keep input and output directories separate.
- Narrow the pattern.
*matches sidecars, hidden files and whatever else lands there. Match the extensions you mean. - Know how to stop it. If a rule misfires you may have dozens of unwanted jobs. Deactivate the rule, then cancel the jobs in bulk from the queue — see Monitoring jobs.