storytellurx/patches/@bureaudouble__autokit-media@9.9.0.patch

27 lines
1.1 KiB
Diff

diff --git a/dist/src/media/ffmpeg.mjs b/dist/src/media/ffmpeg.mjs
index 067bb0d6f20743ab6f5f2a9faa5b6363f7a37234..9d2312786d3f2caf1d054df260574e2594bb3e76 100644
--- a/dist/src/media/ffmpeg.mjs
+++ b/dist/src/media/ffmpeg.mjs
@@ -1,9 +1,10 @@
-import { spawn } from "node:child_process";
import { fromStandardSchema, jsonCodec, jsonValueSchema } from "@bureaudouble/boundary-values";
import "@bureaudouble/media";
import { z } from "@zod/mini";
//#region src/media/ffmpeg.ts
-const run = (command, args) => new Promise((resolve, reject) => {
+const run = async (command, args) => {
+ const { spawn } = await import("node:child_process");
+ return new Promise((resolve, reject) => {
const child = spawn(command, args, { stdio: [
"ignore",
"pipe",
@@ -29,7 +30,8 @@ const run = (command, args) => new Promise((resolve, reject) => {
});
else reject(/* @__PURE__ */ new Error(`${command} failed (${code ?? "signal"}): ${stderr.trim()}`));
});
-});
+ });
+};
const decodedJson = fromStandardSchema(jsonCodec(jsonValueSchema));
const probeOutputSchema = z.object({ streams: z.array(z.object({
width: z.optional(z.number()),