mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
feat: Implement Remotion bundling and rendering scripts.
This commit is contained in:
1 parent
526e608077
commit
1a7cbe6af9
6 files changed
+401
-100
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { bundle } from "@remotion/bundler";
|
||||
import { renderMedia, selectComposition } from "@remotion/renderer";
|
||||
import path from "path";
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
const loc = await bundle({ entryPoint: path.resolve("client/src/remotion/index.ts") });
|
||||
console.log("Bundle success:", loc);
|
||||
const comp = await selectComposition({
|
||||
serveUrl: loc,
|
||||
id: "ImageVideo",
|
||||
inputProps: { images: ["https://placehold.co/1080x1920?text=Image+1"] }
|
||||
});
|
||||
console.log("Comp:", comp?.id);
|
||||
await renderMedia({
|
||||
composition: comp,
|
||||
serveUrl: loc,
|
||||
codec: "h264",
|
||||
outputLocation: path.resolve("out.mp4"),
|
||||
inputProps: { images: ["https://placehold.co/1080x1920?text=Image+1"] }
|
||||
});
|
||||
console.log("Render success!");
|
||||
} catch(e) {
|
||||
console.error("Error rendering", e);
|
||||
}
|
||||
}
|
||||
run();
|
||||
Reference in new issue
Block a user