diegosouzapw/OmniRoute · error · Error

Video exceeds the maximum duration

Error message

Video exceeds the maximum duration

What it means

Guard in the extraction pipeline: the probed video duration exceeds options.maxDurationSeconds (default 600s). Long videos are rejected before any frame extraction to bound processing time and memory.

Solutions

  1. Trim or shorten the video before upload
  2. Raise maxDurationSeconds consciously if the deployment can afford the processing cost
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/guardrails/videoBridgeRuntime.ts:799 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/1f3dc3a3c96949bb. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/guardrails/videoBridgeRuntime.ts:799

      });
    const selectedStream = [...playableVideoStreams].sort((left, right) => {
      const defaultPreference =
        Number(dispositionFlag(right, "default")) - Number(dispositionFlag(left, "default"));
      return defaultPreference || Number(left.index) - Number(right.index);
    })[0];
    if (selectedStream) {
      streamIndex = Number(selectedStream.index);
      width = Number(selectedStream.width);
      height = Number(selectedStream.height);
    }
  } catch {
    // The stable error below deliberately excludes raw ffprobe output.
  }
  if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {
    throw new Error("Video runtime returned invalid duration metadata");
  }
  if (durationSeconds > (options.maxDurationSeconds ?? 600)) {
    throw new Error("Video exceeds the maximum duration");
  }
  const formats = formatName
    .toLowerCase()
    .split(",")
    .map((entry) => entry.trim())
    .filter(Boolean);
  if (formats.length === 0 || formats.some((entry) => !SAFE_FORMATS.has(entry))) {
    throw new Error("Video container format is not allowed");
  }
  if (playableVideoStreamCount === 0) {
    throw new Error("Video container has no playable video stream");
  }
  if (!allVideoStreamsSafe) {
    throw new Error("Video stream metadata or dimensions exceed the safe processing limit");
  }
  return { durationSeconds, formatName, height, streamIndex, width };
}

View on GitHub (pinned to a179ffed5b)