Guide

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.

PartWhat it does
FolderThe directory being watched. The master must be able to read it.
PatternA glob deciding which files qualify — *.mov, *.mp4, or * for everything.
What to produceThe deliverables generated from each matching file.
ActiveWhether the rule is running. Rules are switched off rather than deleted, so you keep the configuration.
Rules belong to a project

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.

Suffixes that mean "still writing"

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.

Waiting for the size to settle

A file whose size is still changing is not ready. The watcher waits for it to stop growing before treating it as complete.

Size-stability is a heuristic, not a guarantee

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.

Prefer this in a facility

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:

PlaceholderBecomes
{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.

Templates that collide overwrite each other

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.