diegosouzapw/OmniRoute · error · Error

Video stream metadata or dimensions exceed the safe…

Error message

Video stream metadata or dimensions exceed the safe processing limit

What it means

Sanity guard after stream selection: the video stream metadata (playable stream count, width/height dimensions) falls outside the safe processing limits, so extraction is refused rather than risking oversized decodes.

Solutions

  1. Downscale the video before uploading
  2. Raise the limits only with matching memory/timeout budgets for ffmpeg
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/guardrails/videoBridgeRuntime.ts:813 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/ad056e3167c3dd02. Report an issue: GitHub.

Appendix: source

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

  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 };
}

export async function extractFramesFromLocalVideo(
  inputPath: string,
  outputDirectory: string,
  options: {
    durationSeconds: number;
    frameCount: number;
    focusWindow?: VideoFocusBounds | null;
    runner?: VideoCommandRunner;
    samplingPolicy?: VideoSamplingPolicy;
    signal?: AbortSignal;
    streamIndex: number;
    timeoutMs?: number;
  }
): Promise<VideoFrameFileList> {

View on GitHub (pinned to a179ffed5b)