{"record":{"id":"585e6c3b52c28e9e","repo":"diegosouzapw/OmniRoute","slug":"video-bridge-processing-timed-out-or-was-aborted","errorCode":null,"errorMessage":"Video Bridge processing timed out or was aborted","messagePattern":"Video Bridge processing timed out or was aborted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/lib/guardrails/videoBridgeHelpers.ts","lineNumber":353,"sourceCode":"\n/**\n * Expand a final caption budget into the bounded pool evaluated by visual deduplication.\n *\n * @param frameCount - Requested number of frames that may reach captioning.\n * @returns One candidate for a one-frame budget, otherwise twice the budget capped at 16.\n */\nexport function resolveVideoDedupCandidateFrameCount(frameCount: number): number {\n  const normalizedFrameCount = Number.isFinite(frameCount) ? Math.floor(frameCount) : 1;\n  const finalFrameCount = Math.max(\n    1,\n    Math.min(VIDEO_DEDUP_MAX_CANDIDATE_FRAMES, normalizedFrameCount)\n  );\n  if (finalFrameCount === 1) return 1;\n  return Math.min(VIDEO_DEDUP_MAX_CANDIDATE_FRAMES, finalFrameCount * 2);\n}\n\nfunction throwIfVideoDedupAborted(signal?: AbortSignal): void {\n  if (signal?.aborted) throw new Error(\"Video Bridge processing timed out or was aborted\");\n}\n\n/**\n * Compare JPEG frames using the versioned 16x16 grayscale visual policy.\n *\n * @param previous - Last frame retained by deduplication.\n * @param current - Candidate frame being evaluated.\n * @param signal - Optional request cancellation signal checked around asynchronous image work.\n * @returns The larger of mean luma delta and the ratio of materially changed cells.\n * @throws When cancelled or when either frame cannot be decoded as a JPEG data URI.\n */\nexport async function compareVideoFramesByGrayscale(\n  previous: VideoCaptionFrame,\n  current: VideoCaptionFrame,\n  signal?: AbortSignal\n): Promise<number> {\n  throwIfVideoDedupAborted(signal);\n  const decode = (dataUri: string): Buffer => {","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/guardrails/videoBridgeHelpers.ts#L335-L371","documentation":"Error \"Video Bridge processing timed out or was aborted\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/guardrails/videoBridgeHelpers.ts:353 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}