fix(engine,cli,producer): address PR #627 review feedback

- engine/chunkEncoder, engine/streamingEncoder: extend `-bf 0` to GPU h264
  paths (nvenc, qsv, vaapi) and `-b_strategy 0` for qsv so GPU-encoded
  outputs avoid negative-DTS freezes too — not just SW libx264.
- engine/videoFrameExtractor: detect mid-path traversal (e.g.
  `assets/../../foo.mp4`) by normalizing first and re-anchoring at the
  project root. Adds a regression test.
- engine/videoFrameExtractor: dedupe stderr "src not resolvable" warnings
  by `video.src` so a comp with N broken sources logs once, not N times.
- engine/videoFrameExtractor.test: drop dynamic `require("node:fs")`,
  use ES `import { writeFileSync } from "node:fs"`.
- engine/ffprobe: extract `readTagCI` helper for case-insensitive ffprobe
  tag reads (will recur for other libavformat-versioned sidecar tags).
- cli/background-removal/pipeline: collapse Quality / QUALITIES /
  QUALITY_CRF / DEFAULT_QUALITY / isQuality surface using
  `Quality = keyof typeof QUALITY_CRF`.
- producer/renderOrchestrator: replace `v.src.startsWith("/")` with
  `isAbsolute(v.src)` in the HDR probe path so Windows absolute paths
  (`C:\...`) aren't treated as relative — matches the audioMixer guard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
James
2026-05-04 20:29:34 -07:00
co-authored by Claude Opus 4.7
parent 39bc3749b4
commit f4ecf96918
7 changed files with 138 additions and 57 deletions
@@ -20,15 +20,15 @@ import { type Device, type ModelId } from "./manager.js";
export type OutputFormat = "webm" | "mov" | "png";
export type Quality = "fast" | "balanced" | "best";
export const QUALITIES: readonly Quality[] = ["fast", "balanced", "best"] as const;
export const QUALITY_CRF: Record<Quality, number> = {
export const QUALITY_CRF = {
fast: 30,
balanced: 18,
best: 12,
};
} as const;
export type Quality = keyof typeof QUALITY_CRF;
export const QUALITIES = Object.keys(QUALITY_CRF) as readonly Quality[];
export const DEFAULT_QUALITY: Quality = "balanced";