fix(cli): align render output naming and add WebM support to studioServer (#109)

## Summary

- CLI render: use timestamped filenames (`project_date_time.ext`) matching the studio's naming convention, preventing overwrites of previous renders
- studioServer: read `fps`/`quality`/`format` from POST body instead of hardcoding `fps:30`/`quality:standard`/`mp4`
- studioServer: use timestamped job IDs matching the studio pattern
- studioServer: fix download endpoint to serve correct content-type for WebM

## Test plan

- [x] `hyperframes render --format webm` outputs timestamped WebM file
- [x] `hyperframes render` outputs timestamped MP4 (no overwrite)
- [x] Studio embedded server (`hyperframes dev`) renders with correct format when selected in UI
- [x] Download endpoint serves correct MIME type for WebM renders
This commit is contained in:
Miguel Ángel
2026-03-28 21:49:10 +01:00
committed by GitHub
parent 40bd159103
commit 95d7dc0623
5 changed files with 198 additions and 66 deletions
+9 -1
View File
@@ -66,6 +66,7 @@ interface RenderInput {
outputPath?: string | null;
fps: 24 | 30 | 60;
quality: "draft" | "standard" | "high";
format?: "mp4" | "webm";
workers?: number;
useGpu: boolean;
debug: boolean;
@@ -97,7 +98,12 @@ function parseRenderOptions(body: Record<string, unknown>): Omit<RenderInput, "p
? body.entryFile.trim()
: undefined;
return { outputPath, fps, quality, workers, useGpu, debug, entryFile };
const format = (["mp4", "webm"].includes(body.format as string) ? body.format : undefined) as
| "mp4"
| "webm"
| undefined;
return { outputPath, fps, quality, workers, useGpu, debug, entryFile, format };
}
async function prepareRenderBody(
@@ -321,6 +327,7 @@ export function createRenderHandlers(options: HandlerOptions = {}): RenderHandle
const job = createRenderJob({
fps: input.fps,
quality: input.quality,
format: input.format,
workers: input.workers,
useGpu: input.useGpu,
debug: input.debug,
@@ -433,6 +440,7 @@ export function createRenderHandlers(options: HandlerOptions = {}): RenderHandle
const job = createRenderJob({
fps: input.fps,
quality: input.quality,
format: input.format,
workers: input.workers,
useGpu: input.useGpu,
debug: input.debug,