Skip to content
简体中文

Batch processing and scripting ​

Save jobs as jobs.json. Relative paths resolve from the manifest's directory:

json
{
  "schema_version": 1,
  "defaults": {"quality": 90, "existing": "replace"},
  "execution": {"workers": 4, "thread_budget": 4, "memory_budget_mib": 4096},
  "jobs": [{
    "id": "frame-0001",
    "sequence_id": "shot-beauty",
    "input": "frames/beauty.0001.exr",
    "outputs": [
      {"path": "previews/0001.jpg", "size": [960, 960]},
      {"path": "previews/0001.small.jpg", "size": [425, 260]}
    ]
  }]
}
sh
thumbgen batch --manifest jobs.json --json

defaults provides shared conversion options; each job's options can override them. Outputs can set their own size, format, quality and existing-file behavior. Use a unique id to match results. Optional sequence_id keeps sequence selection consistent.

Set "defaults": {"visualization": "auto"} to select a color, Cryptomatte or Deep opacity preview for each eligible file in one batch. An explicit deep_mode: "reject" in defaults or job options disables the opacity fallback. When the AOV is known, set its mode and channels directly in the job's options. Integrations can check for auto in the visualization_modes returned by capabilities --json.

Read results ​

--json streams UTF-8 JSON lines to stdout and diagnostics to stderr. Each job produces one type: result; the final record is type: summary. Concurrent results arrive in completion order, so match by id, not line number.

Automatic EXR selection markers appear in the result's warnings array and as standalone stderr lines. Use the stderr lines when counting warning events.

statusMeaning
successConversion completed
partialSome outputs succeeded and others failed
failedJob failed; check the job or output error
skippedSkipped by the existing-file policy
cancelledUser cancelled; saved outputs remain

outputs contains per-output status and warnings contains notices. Handle errors by error.code, not by parsing message text. summary.output_counts includes all targets, including outputs not attempted.

Exit codes ​

CodeMeaning
0Completed, allowing explicit skips
1Internal error
2Invalid arguments or manifest
3Some work completed, with failures
4All work failed
130Cancellation accepted

Use output statuses and the exit code to decide which files to process next. See file handling and the command reference for resource budgets.