Files
videobeaux/docs/_site/programs/utilities/chain_builder.md
2025-12-07 22:04:44 -05:00

61 lines
2.7 KiB
Markdown

# chain_builder
:contentReference[oaicite:1]{index=1}
## Description
Assembles a sequence of Videobeaux program steps into a single automated workflow, chaining multiple transformations into one output.
Allows creators to design multi-stage processing pipelines without running several commands manually.
## Purpose
`chain_builder` enables complex, multi-step Videobeaux workflows such as:
- running tonemap → gamma_fix → lut_apply → watermark in one sequence,
- preparing media through multiple normalization steps,
- automating creative pipelines for repeatable results,
- building advanced transformations without shell scripts,
- simplifying batch workflows across large media libraries.
This tool acts as a meta-controller that executes multiple Videobeaux programs in the specified order.
## How It Works
1. **Chain Input**
The `chain` argument accepts a structured definition of steps, typically referencing individual Videobeaux modules.
2. **Sequential Execution**
Each step in the chain is executed in the order provided—output from one step becomes input for the next.
3. **Intermediate Handling**
Temporary outputs may be generated (depending on implementation) before the final render is written.
4. **Final Output**
The result of the last program in the sequence is written to `-o`.
## Program Template
videobeaux -P chain_builder \
-i input.mp4 \
-o output.mp4 \
--chain VALUE
## Arguments
- **chain** — A structured representation of the ordered programs to run (e.g., a serialized list or JSON-like definition).
## Real World Example
videobeaux -P chain_builder \
-i myvideo.mp4 \
-o chain_builder_styled.mp4 \
--chain EXAMPLE
## Technical Notes
- Each chained step operates exactly as if run individually via Videobeaux.
- Temporary intermediate files may be used depending on the complexity of the pipeline.
- Errors in any step cause the chain to halt unless fault-tolerance logic is implemented.
- Useful for combining CPU/GPU-heavy operations into one reproducible pipeline.
## Recommended Usage
- Full preprocessing pipelines (denoise → gamma fix → resize → LUT).
- Automated delivery formatting for episodic or batch workflows.
- Creative chains applying several stylizations in sequence.
- Rapid prototyping of multi-step effects before writing scripts.
## Quality Tips
- Keep chains readable and modular; long chains are easier to maintain when broken into logical groups.
- Validate each step independently before adding it to a chain.
- Store commonly used chains in version control to maintain consistency.
- Ensure your intermediate steps output in a high-quality format to avoid cumulative degradation.