@open-take/compositor 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +136 -33
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/decode-guard.ts +35 -0
- package/src/ffmpeg.ts +41 -1
- package/src/render.ts +142 -57
- package/src/scene/scene.tsx +40 -0
package/dist/index.d.ts
CHANGED
|
@@ -569,6 +569,10 @@ declare function finishName(mb: MotionBlurConfig | undefined): FinishName | null
|
|
|
569
569
|
//#region src/ffmpeg.d.ts
|
|
570
570
|
//# sourceMappingURL=presets.d.ts.map
|
|
571
571
|
declare function resolveFfmpeg(): Promise<string>;
|
|
572
|
+
/** True when an `ffmpeg -encoders` table has a video-encoder ROW named
|
|
573
|
+
* `encoder` (" V....D libx264 ..."), not merely the name as a substring
|
|
574
|
+
* somewhere — descriptions repeat encoder names constantly. */
|
|
575
|
+
|
|
572
576
|
declare function resolveFfprobe(): Promise<string>;
|
|
573
577
|
|
|
574
578
|
//#endregion
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/presets.ts","../src/ffmpeg.ts","../src/plan.ts","../src/camera.ts","../src/validate.ts","../src/render.ts","../src/math.ts"],"sourcesContent":null,"mappings":";;;KAMY,EAAA;;;AAAZ,CAAA;AACY,KAAA,IAAA,GAAI;;EAKJ,CAAA,EAAA,MAAA;;;AAIZ,CAAA;;AAKQ,KATI,UAAA,GASJ,MAAA,GAAA,OAAA,GAAA,QAAA;;;AAoBU,KAzBN,gBAAA,GAyBM;;EAUN,CAAA,EAAA,MAAA;;;EAIA,GAAA,CAAA,EAlCJ,IAkCI;;;EAUA;;;EAiBA;;;AAUZ;;;;;SAzDS;;;AAsET;;;cAhEc;EAyEF;;;;;;AAaZ,CAAA;AA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,CAAA,EAAA,MAAA,GAAA,MAAA;IAAI,SAAA,CAAA,EAAA,MAAA;EA0BlB,CAAA;EA+BZ,QAAA,EAAA;IA/ByD,CAAA,EAAA,MAAA;IAArC,CAAA,EAAA,MAAA;EAAM,CAAA;EAgCf;;;;;;EAOC,KAAA,CAAA,EAAA;IAIG,CAAA,EAAA,MAAU;IAAA,CAAA,EAAA,MAAA;EAAA,CAAA;EAAqB;EAAa,MAAA,EDqDlD,YCrDkD,EAAA;EAuBhD,MAAA,CAAA,EAAA,MAAU;EAAA;;;AAAO;EAMhB,OAAA,CAyCZ,EAAA;IAAA,IAAA,EAAA,MAAA;IAzCkC,MAAA,EAAA,MAAA;IAAf,MAAA,CAAA,EAAA,MAAA;IAAM,MAAA,EAAA,MAAA;EA0Cd,CAAA,EAAA;EAEI;AAchB;;;;AAA2B;EAKf,WAAA,CAAA,EAAU;IAEN,IAAA,EAAA,MAAU;IAAA,MAAA,EAAA,MAAA;IAAK,MAAA,EAAA,MAAA;IAA+B,QAAA,EAAA,MAAA;IAAU,MAAA,EAAA,MAAA,GAAA,QAAA,GAAA,aAAA;;;;ACrJxE;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types.ts","../src/presets.ts","../src/ffmpeg.ts","../src/plan.ts","../src/camera.ts","../src/validate.ts","../src/render.ts","../src/math.ts"],"sourcesContent":null,"mappings":";;;KAMY,EAAA;;;AAAZ,CAAA;AACY,KAAA,IAAA,GAAI;;EAKJ,CAAA,EAAA,MAAA;;;AAIZ,CAAA;;AAKQ,KATI,UAAA,GASJ,MAAA,GAAA,OAAA,GAAA,QAAA;;;AAoBU,KAzBN,gBAAA,GAyBM;;EAUN,CAAA,EAAA,MAAA;;;EAIA,GAAA,CAAA,EAlCJ,IAkCI;;;EAUA;;;EAiBA;;;AAUZ;;;;;SAzDS;;;AAsET;;;cAhEc;EAyEF;;;;;;AAaZ,CAAA;AAcA;AAAwB,KA1FZ,YAAA,GAAe,gBA0FH,GAAA;E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@@ async function resolveFfmpeg() {
|
|
|
284
284
|
}
|
|
285
285
|
throw new Error("ffmpeg not found — install it (e.g. `brew install ffmpeg`) or `npm install` so the bundled @ffmpeg-installer binary resolves for this platform");
|
|
286
286
|
}
|
|
287
|
+
/** True when an `ffmpeg -encoders` table has a video-encoder ROW named
|
|
288
|
+
* `encoder` (" V....D libx264 ..."), not merely the name as a substring
|
|
289
|
+
* somewhere — descriptions repeat encoder names constantly. */
|
|
290
|
+
function parseEncoders(encodersText, encoder) {
|
|
291
|
+
const escaped = encoder.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
292
|
+
return new RegExp(`^\\s*V\\S{5}\\s+${escaped}(?:\\s|$)`, "m").test(encodersText);
|
|
293
|
+
}
|
|
294
|
+
const encoderCache = new Map();
|
|
295
|
+
/** True when the RESOLVED ffmpeg (resolveFfmpeg — which may be a system
|
|
296
|
+
* binary lacking libvpx-vp9) offers the named video encoder. Cached per
|
|
297
|
+
* name; any failure is false, never a throw. */
|
|
298
|
+
function ffmpegHasEncoder(name) {
|
|
299
|
+
let cached = encoderCache.get(name);
|
|
300
|
+
if (!cached) {
|
|
301
|
+
cached = hasEncoderOnce(name).catch(() => false);
|
|
302
|
+
encoderCache.set(name, cached);
|
|
303
|
+
}
|
|
304
|
+
return cached;
|
|
305
|
+
}
|
|
306
|
+
async function hasEncoderOnce(name) {
|
|
307
|
+
const ffmpeg = await resolveFfmpeg();
|
|
308
|
+
const text = await new Promise((res, rej) => {
|
|
309
|
+
const child = spawn(ffmpeg, ["-hide_banner", "-encoders"], { stdio: [
|
|
310
|
+
"ignore",
|
|
311
|
+
"pipe",
|
|
312
|
+
"ignore"
|
|
313
|
+
] });
|
|
314
|
+
let out = "";
|
|
315
|
+
child.stdout.on("data", (d) => {
|
|
316
|
+
out += d;
|
|
317
|
+
});
|
|
318
|
+
child.on("error", rej);
|
|
319
|
+
child.on("close", (code) => code === 0 ? res(out) : rej(new Error(`ffmpeg -encoders exited ${code}`)));
|
|
320
|
+
});
|
|
321
|
+
return parseEncoders(text, name);
|
|
322
|
+
}
|
|
287
323
|
async function resolveFfprobe() {
|
|
288
324
|
if (cachedFfprobe) return cachedFfprobe;
|
|
289
325
|
if (runsOk("ffprobe")) {
|
|
@@ -1328,6 +1364,17 @@ function manualFraming(b, rest) {
|
|
|
1328
1364
|
};
|
|
1329
1365
|
}
|
|
1330
1366
|
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region src/decode-guard.ts
|
|
1369
|
+
const CAPTURE_UNDECODABLE_MARK = "capture video is not decodable in the render browser";
|
|
1370
|
+
/** Did this render rejection come from the scene's decode guard? Substring
|
|
1371
|
+
* match on the message — the Error identity does not survive the
|
|
1372
|
+
* browser→Node crossing. */
|
|
1373
|
+
function isCaptureUndecodable(err) {
|
|
1374
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1375
|
+
return message.includes(CAPTURE_UNDECODABLE_MARK);
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1331
1378
|
//#endregion
|
|
1332
1379
|
//#region src/validate.ts
|
|
1333
1380
|
/** Tail past the last beat's settle that still reads as "the shot breathing".
|
|
@@ -1574,21 +1621,45 @@ function run(cmd, args) {
|
|
|
1574
1621
|
}
|
|
1575
1622
|
/** Normalise the capture to a constant-fps mp4 the web decoder can read.
|
|
1576
1623
|
* fps follows the composition so a hi-fps capture can render at 60 (the
|
|
1577
|
-
* render grid must match — a 30-grid would throw away the extra frames).
|
|
1578
|
-
|
|
1624
|
+
* render grid must match — a 30-grid would throw away the extra frames).
|
|
1625
|
+
*
|
|
1626
|
+
* `codec` is normally h264; "vp9" is the retry arm for render browsers
|
|
1627
|
+
* WITHOUT H.264 decoding (Playwright-style Chromium builds ship no
|
|
1628
|
+
* proprietary codecs). The scene's decode guard rejects in seconds when the
|
|
1629
|
+
* capture can't decode there (see src/decode-guard.ts); renderTakeExclusive
|
|
1630
|
+
* catches that rejection and re-encodes the scratch capture with this arm
|
|
1631
|
+
* before one retry. The VP9 fallback must keep the .mp4 container AND the
|
|
1632
|
+
* capture.mp4 name: revideo routes video decoding by file extension, so a
|
|
1633
|
+
* .webm would take a different (and broken) decode path — VP9-in-MP4 (vp09
|
|
1634
|
+
* track) is the shape that works. */
|
|
1635
|
+
async function toMp4(videoPath, outMp4, fps, codec) {
|
|
1579
1636
|
await mkdir(dirname(outMp4), { recursive: true });
|
|
1637
|
+
const codecArgs = codec === "vp9" ? [
|
|
1638
|
+
"-c:v",
|
|
1639
|
+
"libvpx-vp9",
|
|
1640
|
+
"-b:v",
|
|
1641
|
+
"0",
|
|
1642
|
+
"-crf",
|
|
1643
|
+
"24",
|
|
1644
|
+
"-row-mt",
|
|
1645
|
+
"1",
|
|
1646
|
+
"-cpu-used",
|
|
1647
|
+
"4"
|
|
1648
|
+
] : [
|
|
1649
|
+
"-c:v",
|
|
1650
|
+
"libx264",
|
|
1651
|
+
"-crf",
|
|
1652
|
+
"18"
|
|
1653
|
+
];
|
|
1580
1654
|
await run(await resolveFfmpeg(), [
|
|
1581
1655
|
"-y",
|
|
1582
1656
|
"-loglevel",
|
|
1583
1657
|
"error",
|
|
1584
1658
|
"-i",
|
|
1585
1659
|
resolve(videoPath),
|
|
1586
|
-
|
|
1587
|
-
"libx264",
|
|
1660
|
+
...codecArgs,
|
|
1588
1661
|
"-pix_fmt",
|
|
1589
1662
|
"yuv420p",
|
|
1590
|
-
"-crf",
|
|
1591
|
-
"18",
|
|
1592
1663
|
"-r",
|
|
1593
1664
|
String(fps),
|
|
1594
1665
|
"-an",
|
|
@@ -1699,7 +1770,7 @@ async function prepareScratch(composition, videoPath) {
|
|
|
1699
1770
|
const nm = hostNodeModules();
|
|
1700
1771
|
if (!nm) throw new Error("render: could not locate node_modules for the scene's imports");
|
|
1701
1772
|
await symlink(nm, join(dir, "node_modules"), "junction");
|
|
1702
|
-
await toMp4(videoPath, join(dir, "public", "capture.mp4"), composition.output.fps);
|
|
1773
|
+
await toMp4(videoPath, join(dir, "public", "capture.mp4"), composition.output.fps, "h264");
|
|
1703
1774
|
return dir;
|
|
1704
1775
|
} catch (error) {
|
|
1705
1776
|
await cleanupScratch(dir);
|
|
@@ -1729,39 +1800,71 @@ async function renderTakeExclusive(opts) {
|
|
|
1729
1800
|
await repairBundledMediaPermissions();
|
|
1730
1801
|
const scratch = await prepareScratch(composition, opts.videoPath);
|
|
1731
1802
|
const deps = depsRoot();
|
|
1803
|
+
const videoAbs = resolve(opts.videoPath);
|
|
1732
1804
|
try {
|
|
1733
1805
|
if (process.env.DISABLE_TELEMETRY === void 0) process.env.DISABLE_TELEMETRY = "true";
|
|
1806
|
+
const renderOnce = async () => {
|
|
1807
|
+
let noProgressTimer = setTimeout(() => {
|
|
1808
|
+
process.stderr.write("open-take: no render progress after 3 minutes — if this never advances, the render browser may be stuck decoding the capture (see OPEN_TAKE_CHROME)\n");
|
|
1809
|
+
}, 18e4);
|
|
1810
|
+
try {
|
|
1811
|
+
return await renderVideo({
|
|
1812
|
+
projectFile: "/src/scene/project.ts",
|
|
1813
|
+
settings: {
|
|
1814
|
+
outFile: "take.mov",
|
|
1815
|
+
outDir: RENDER_OUT,
|
|
1816
|
+
workers: 1,
|
|
1817
|
+
projectSettings: {
|
|
1818
|
+
exporter: {
|
|
1819
|
+
name: "@revideo/core/ffmpeg",
|
|
1820
|
+
options: { format: "proRes" }
|
|
1821
|
+
},
|
|
1822
|
+
...rangeSec ? { range: rangeSec } : {}
|
|
1823
|
+
},
|
|
1824
|
+
logProgress: opts.logProgress ?? false,
|
|
1825
|
+
progressCallback: (_worker, progress) => {
|
|
1826
|
+
if (noProgressTimer !== void 0) {
|
|
1827
|
+
clearTimeout(noProgressTimer);
|
|
1828
|
+
noProgressTimer = void 0;
|
|
1829
|
+
}
|
|
1830
|
+
opts.onProgress?.(progress);
|
|
1831
|
+
},
|
|
1832
|
+
viteConfig: { server: { fs: { allow: [scratch, ...deps ? [deps] : []] } } },
|
|
1833
|
+
puppeteer: {
|
|
1834
|
+
args: [
|
|
1835
|
+
"--no-sandbox",
|
|
1836
|
+
"--disable-setuid-sandbox",
|
|
1837
|
+
"--password-store=basic",
|
|
1838
|
+
"--use-mock-keychain"
|
|
1839
|
+
],
|
|
1840
|
+
executablePath: opts.chromePath
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1844
|
+
} finally {
|
|
1845
|
+
if (noProgressTimer !== void 0) clearTimeout(noProgressTimer);
|
|
1846
|
+
}
|
|
1847
|
+
};
|
|
1734
1848
|
const prevCwd = process.cwd();
|
|
1735
1849
|
process.chdir(scratch);
|
|
1736
1850
|
let produced;
|
|
1737
1851
|
try {
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
...opts.onProgress ? { progressCallback: (_worker, progress) => opts.onProgress(progress) } : {},
|
|
1753
|
-
viteConfig: { server: { fs: { allow: [scratch, ...deps ? [deps] : []] } } },
|
|
1754
|
-
puppeteer: {
|
|
1755
|
-
args: [
|
|
1756
|
-
"--no-sandbox",
|
|
1757
|
-
"--disable-setuid-sandbox",
|
|
1758
|
-
"--password-store=basic",
|
|
1759
|
-
"--use-mock-keychain"
|
|
1760
|
-
],
|
|
1761
|
-
executablePath: opts.chromePath
|
|
1762
|
-
}
|
|
1852
|
+
try {
|
|
1853
|
+
produced = await renderOnce();
|
|
1854
|
+
} catch (error) {
|
|
1855
|
+
if (!isCaptureUndecodable(error)) throw error;
|
|
1856
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
1857
|
+
if (!await ffmpegHasEncoder("libvpx-vp9")) throw new Error(`render: the browser at ${opts.chromePath} cannot decode the capture (${detail}) — point OPEN_TAKE_CHROME at a full Chrome/Chrome-for-Testing build, or install an ffmpeg with libvpx-vp9 to enable the VP9 fallback`, { cause: error });
|
|
1858
|
+
process.stderr.write("open-take: the render browser cannot decode the H.264 capture — retrying with a VP9 intermediate (output unchanged)\n");
|
|
1859
|
+
await toMp4(videoAbs, join(scratch, "public", "capture.mp4"), composition.output.fps, "vp9");
|
|
1860
|
+
try {
|
|
1861
|
+
produced = await renderOnce();
|
|
1862
|
+
} catch (retryError) {
|
|
1863
|
+
if (!isCaptureUndecodable(retryError)) throw retryError;
|
|
1864
|
+
const retryDetail = retryError instanceof Error ? retryError.message : String(retryError);
|
|
1865
|
+
throw new Error(`render: the browser at ${opts.chromePath} cannot decode the capture even as VP9 (${retryDetail}) — point OPEN_TAKE_CHROME at a full Chrome/Chrome-for-Testing build`, { cause: retryError });
|
|
1763
1866
|
}
|
|
1764
|
-
}
|
|
1867
|
+
}
|
|
1765
1868
|
} finally {
|
|
1766
1869
|
process.chdir(prevCwd);
|
|
1767
1870
|
}
|