Skip to content

Write HTML. Render video. Built for agents.

docs(engine,producer): describe the opt-in duration cap where the gate's callers read it

Vance Ingalls172cac433d46
diff --git a/packages/engine/src/config.ts b/packages/engine/src/config.ts
index ebb31c7fd2..2c7c98472c 100644
--- a/packages/engine/src/config.ts
+++ b/packages/engine/src/config.ts
@@ -163,7 +163,10 @@ export interface EngineConfig {
* Max composition duration eligible for streaming encode (seconds). Only
* applied when `streamingEncodeDurationCapEnabled` is true. Historical: the
* 240 s default (#579) guarded a total-render ffmpeg timeout that became an
- * inactivity timeout in efc16a945, so the cap is off by default.
+ * inactivity timeout in efc16a945, so the cap is off by default. Because of
+ * that, `PRODUCER_STREAMING_ENCODE_MAX_DURATION_SECONDS=0` no longer
+ * disables streaming on its own; `PRODUCER_ENABLE_STREAMING_ENCODE=false`
+ * is the supported off switch.
*/
streamingEncodeMaxDurationSeconds: number;
/**
diff --git a/packages/producer/src/services/renderOrchestrator.ts b/packages/producer/src/services/renderOrchestrator.ts
index 05994331d8..f47d6e939c 100644
--- a/packages/producer/src/services/renderOrchestrator.ts
+++ b/packages/producer/src/services/renderOrchestrator.ts
@@ -2190,9 +2190,12 @@ export function shouldPreferParallelDrawElement(args: {
* (`shouldUseStreamingEncode` at the router's worker count with
* forceParallelStream). The router's entire value is that path; without it
* firing would pin workerCount to 3 and skip calibration while delivering
- * none of the benefit — e.g. a composition longer than
- * `streamingEncodeMaxDurationSeconds` (240 s default), where the duration
- * cap disables streaming before the router's force flag is consulted.
+ * none of the benefit — e.g. png-sequence / gif output, streaming disabled
+ * by config, or — only when the operator opt-in
+ * `streamingEncodeDurationCapEnabled` is on — a composition longer than
+ * `streamingEncodeMaxDurationSeconds` (240 s), where the duration cap
+ * disables streaming before the router's force flag is consulted. With the
+ * cap off (the default) long compositions are eligible here too.
*/
parallelStreamingAvailable: boolean;
/** Machine RAM (os.totalmem, MB). */
@@ -3531,8 +3534,9 @@ async function executeRenderPipeline(input: {
process.env.PRODUCER_EXPERIMENTAL_FAST_CAPTURE === "true" ||
process.env.HF_DE_PARALLEL_STREAM === "true",
routerEnabled: deParallelRouterEnabled,
- // Router pins 3 workers for the streaming path; don't pin when the
- // duration cap (or any other streaming gate) would turn that path off.
+ // Router pins 3 workers for the streaming path; don't pin when a
+ // streaming gate (config, format, or the opt-in duration cap) would turn
+ // that path off.
parallelStreamingAvailable: shouldUseStreamingEncode(
cfg,
outputFormat,