{"record":{"id":"00ab69f25952dd45","repo":"diegosouzapw/OmniRoute","slug":"video-structural-analysis-requires-a-positive-dura","errorCode":null,"errorMessage":"Video structural analysis requires a positive duration","messagePattern":"Video structural analysis requires a positive duration","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/guardrails/videoBridgeRuntime.ts","lineNumber":310,"sourceCode":"  return starts\n    .map((start, index) => {\n      const startSeconds = Math.max(0, Math.min(durationSeconds, start));\n      const inferredEnd = start + (durations[index] ?? durationSeconds - start);\n      const endSeconds = Math.max(\n        startSeconds,\n        Math.min(durationSeconds, ends[index] ?? inferredEnd)\n      );\n      return { endSeconds, startSeconds };\n    })\n    .filter((interval) => interval.endSeconds - interval.startSeconds >= 1);\n}\nexport function parseVideoStructuralAnalysis(\n  metadataOutput: string,\n  diagnosticOutput: string,\n  durationSeconds: number\n): VideoStructuralAnalysis {\n  if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {\n    throw new Error(\"Video structural analysis requires a positive duration\");\n  }\n  const samples = parseStructuralSamples(metadataOutput, durationSeconds);\n  const diagnosticScenes = [\n    ...diagnosticOutput.matchAll(/lavfi\\.scd\\.score:\\s*[\\d.]+,\\s*lavfi\\.scd\\.time:\\s*([\\d.]+)/g),\n  ].map((match) => Number(match[1]));\n  return {\n    freezeIntervals: parseFreezeIntervals(diagnosticOutput, durationSeconds),\n    samples,\n    sceneCandidates: normalizeSceneCandidates(durationSeconds, [\n      ...samples\n        .filter((sample) => (sample.sceneScore ?? 0) >= VIDEO_STRUCTURAL_SCENE_THRESHOLD)\n        .map((sample) => sample.timestampSeconds),\n      ...diagnosticScenes,\n    ]),\n  };\n}\ninterface StructuralSamplingSegment {\n  endSeconds: number;","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/guardrails/videoBridgeRuntime.ts#L292-L328","documentation":"Error \"Video structural analysis requires a positive duration\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/guardrails/videoBridgeRuntime.ts:310 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"}