diegosouzapw/OmniRoute · error
Extracted video total frame byte limit exceeded
Error message
Extracted video total frame byte limit exceeded
What it means
Guard in readBoundedExtractedFrames(): the summed size of all extracted frame files exceeds maxTotalBytes (default VIDEO_FRAMES_TOTAL_MAX_BYTES). Prevents a multi-frame extraction from loading unbounded data into memory.
Solutions
- Reduce the requested frame count so the total stays under the cap
- Raise the total budget only with a matching memory ceiling
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/lib/guardrails/videoBridgeRuntime.ts:941 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/a0f6979485b530b5.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/guardrails/videoBridgeRuntime.ts:941
return frames;
}
export async function readBoundedExtractedFrames(
frames: readonly VideoFrameFile[],
options: { maxFrameBytes?: number; maxTotalBytes?: number } = {}
): Promise<Buffer[]> {
const maxFrameBytes = options.maxFrameBytes ?? VIDEO_FRAME_MAX_BYTES;
const maxTotalBytes = options.maxTotalBytes ?? VIDEO_FRAMES_TOTAL_MAX_BYTES;
let totalBytes = 0;
const sizes: number[] = [];
for (const frame of frames) {
const metadata = await stat(frame.path);
if (!metadata.isFile() || metadata.size < 1 || metadata.size > maxFrameBytes) {
throw new Error("Extracted video frame byte limit exceeded");
}
totalBytes += metadata.size;
if (totalBytes > maxTotalBytes) {
throw new Error("Extracted video total frame byte limit exceeded");
}
sizes.push(metadata.size);
}
const output: Buffer[] = [];
for (let index = 0; index < frames.length; index++) {
const bytes = await readFile(frames[index].path);
if (bytes.byteLength !== sizes[index]) {
throw new Error("Extracted video frame changed before it could be read");
}
output.push(bytes);
}
return output;
}
export async function extractVideoFramesFromBytes(
bytes: Uint8Array,
options: {View on GitHub (pinned to a179ffed5b)