{"record":{"id":"03ee3989f6180ab1","repo":"nexu-io/open-design","slug":"vela-video-only-supports-aspect-ratios-16-9-9-16","errorCode":null,"errorMessage":"Vela video only supports aspect ratios 16:9, 9:16, or 1:1; received ${ratio}","messagePattern":"Vela video only supports aspect ratios 16:9, 9:16, or 1:1; received (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/vela.ts","lineNumber":422,"sourceCode":"      // was chosen and say so plainly when the server's default decided.\n      providerNote: `vela/${wireModel} · ${\n        profile ? `${profile.aspectRatio} ${profile.resolution}` : 'model default profile'\n      } · ${requestedQuality ?? 'model default quality'} · ${bytes.length} bytes`,\n      suggestedExt: extensionForImageMime(mime),\n    };\n  } finally {\n    await rm(tempDir, { recursive: true, force: true });\n  }\n}\n\nexport async function renderVelaVideo(\n  input: VelaVideoRenderInput,\n  runCommand: VelaCommandRunner = runVelaCommand,\n): Promise<VelaRenderResult> {\n  assertInputImageCount(input.imageRefs);\n  const ratio = input.aspect ?? '16:9';\n  if (!VELA_VIDEO_RATIOS.has(ratio)) {\n    throw new Error(`Vela video only supports aspect ratios 16:9, 9:16, or 1:1; received ${ratio}`);\n  }\n  if (input.length != null && !VELA_VIDEO_DURATIONS.has(input.length)) {\n    throw new Error(`Vela video only supports durations of 5 or 10 seconds; received ${input.length}`);\n  }\n\n  const wireModel = wireModelForVela(input.model, input.wireModel);\n  const tempDir = await mkdtemp(path.join(os.tmpdir(), 'open-design-vela-video-'));\n  const outputPath = path.join(tempDir, 'result.mp4');\n  const startedAt = Date.now();\n  const pollIntervalMs = positiveIntegerFromEnv(\n    'OD_VELA_VIDEO_POLL_INTERVAL_MS',\n    DEFAULT_VELA_VIDEO_POLL_INTERVAL_MS,\n  );\n  const totalTimeoutMs = positiveIntegerFromEnv(\n    'OD_VELA_VIDEO_TIMEOUT_MS',\n    DEFAULT_VELA_VIDEO_TOTAL_TIMEOUT_MS,\n  );\n  const pollCommandTimeoutMs = positiveIntegerFromEnv(","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/vela.ts#L404-L440","documentation":"Thrown by renderVelaVideo when input.aspect is not one of the three supported ratios. The valid set is VELA_VIDEO_RATIOS = new Set(['16:9', '9:16', '1:1']). The default is '16:9' when input.aspect is nullish, so this error only fires when an explicit unsupported value is supplied.","triggerScenarios":"Calling renderVelaVideo or the /api/media video route with input.aspect set to any string outside {16:9, 9:16, 1:1} — e.g. '4:3', '2:1', '3:2', '16:09', '1.77:1'.","commonSituations":"A UI dropdown passing a newly-added or stale ratio option the backend doesn't support; an API caller assuming arbitrary ratios are accepted; typos like '16:09' or decimal ratios like '1.78:1'.","solutions":["Set input.aspect to exactly one of '16:9', '9:16', or '1:1'","Omit input.aspect entirely to use the '16:9' default","If building a caller UI, restrict the dropdown options to the three supported values"],"exampleFix":"// before\nrenderVelaVideo({ aspect: '4:3', imageRefs: refs, ... });\n\n// after\nrenderVelaVideo({ aspect: '16:9', imageRefs: refs, ... });\n// or omit aspect to default to 16:9\nrenderVelaVideo({ imageRefs: refs, ... });","handlingStrategy":"validation","validationCode":"const VELA_VIDEO_RATIOS = new Set(['16:9', '9:16', '1:1']);\nfunction assertValidVelaRatio(aspect) {\n  const ratio = aspect ?? '16:9';\n  if (!VELA_VIDEO_RATIOS.has(ratio)) {\n    throw new Error(`Unsupported aspect ratio: ${ratio}. Use 16:9, 9:16, or 1:1.`);\n  }\n  return ratio;\n}","typeGuard":"function isVelaVideoRatio(value: unknown): value is '16:9' | '9:16' | '1:1' {\n  return typeof value === 'string' && ['16:9', '9:16', '1:1'].includes(value);\n}","tryCatchPattern":null,"preventionTips":["Restrict UI dropdowns to the three supported ratios so users can never select an invalid value","Validate input.aspect before calling renderVelaVideo rather than relying on the internal throw","Document the supported ratios at the API boundary"],"tags":["vela","video","validation","media"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}