mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-26 00:57:05 +00:00
fix(media-use): carve decodes only media files inside the composition's folder (#8649)
* fix(media-use): carve decodes only media files inside the composition's folder carve.mjs resolved each media src from the composition and handed the result to ffmpeg, so an absolute, climbing, UNC or linked name reached a file outside the project, and a playlist inside the project was followed to the files it lists. Each src must now be a relative name that lands on a regular file inside the composition's folder after links are resolved, outside the files the project keeps private, and free of ffmpeg pattern characters. Every source is checked before any is decoded. ffmpeg then reads the one file, pinned to its probed format and the file protocol, and a list or playlist format is refused. The probe and the pinned input move from recording.mjs into lib/media-input.mjs so both scripts share them. The private-path rule and the image2 pattern guard are bundled into audio-carve.mjs from packages/parsers. * fix(media-use): media-input.mjs loads the Windows program guard first Every skill script that starts programs imports windows-exe-search.mjs before anything else, so ffprobe and ffmpeg are never looked up in the working directory on Windows.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
// Bundles the carve analysis carve.mjs uses (packages/core/src/audioCarve.ts and audioFx.ts) into a single
|
||||
// Bundles the carve analysis carve.mjs uses (packages/core/src/audioCarve.ts and audioFx.ts), and the private-path
|
||||
// rule it checks sources with (packages/parsers/src/privatePath.ts), into a single
|
||||
// import-free .mjs beside the skill, so the skill never loads @hyperframes/core from the project it edits.
|
||||
// Regenerate after editing the source: node scripts/generate-media-use-audio-carve.mjs
|
||||
import { writeFileSync } from "node:fs";
|
||||
@@ -29,11 +30,13 @@ export {
|
||||
parseAudioFxChain,
|
||||
serializeAudioFxChain,
|
||||
} from "./audioFx.ts";
|
||||
export { isStudioPrivatePath } from "../../parsers/src/privatePath.ts";
|
||||
`;
|
||||
|
||||
const HEADER = `// GENERATED: do not hand-edit. Source: packages/core/src/audioCarve.ts and audioFx.ts, bundled by
|
||||
// scripts/generate-media-use-audio-carve.mjs so carve.mjs runs the same analysis as Studio without
|
||||
// loading @hyperframes/core from the project. Regenerate: node scripts/generate-media-use-audio-carve.mjs
|
||||
const HEADER = `// GENERATED: do not hand-edit. Source: packages/core/src/audioCarve.ts and audioFx.ts, and
|
||||
// packages/parsers/src/privatePath.ts, bundled by scripts/generate-media-use-audio-carve.mjs so carve.mjs
|
||||
// runs the same analysis and private-path rule as Studio without loading @hyperframes/core from the project.
|
||||
// Regenerate: node scripts/generate-media-use-audio-carve.mjs
|
||||
`;
|
||||
|
||||
export async function generate() {
|
||||
|
||||
Reference in New Issue
Block a user