mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
feat: Add Remotion rendering API with TTS and update Dockerfile to use Debian-slim for Remotion's glibc-dependent Chrome headless shell.
This commit is contained in:
1 parent
fa4e6e3131
commit
4f69a2edda
2 files changed
+43
-68
No files matched your search
@@ -171,26 +171,12 @@ remotionRouter.post("/render", upload.array("images", 4), async (req, res) => {
|
||||
|
||||
console.log("🎬 Rendering media...", effectiveDurationInFrames, "frames");
|
||||
|
||||
// Find system Chromium: path written during Docker build, or fallback to common locations
|
||||
let browserExecutable: string | undefined;
|
||||
const savedPath = "/app/.chromium-path";
|
||||
if (fs.existsSync(savedPath)) {
|
||||
const p = fs.readFileSync(savedPath, "utf-8").trim();
|
||||
if (p && fs.existsSync(p)) browserExecutable = p;
|
||||
}
|
||||
if (!browserExecutable) {
|
||||
const chromiumPaths = ["/usr/bin/chromium-browser", "/usr/bin/chromium"];
|
||||
browserExecutable = chromiumPaths.find(p => fs.existsSync(p));
|
||||
}
|
||||
console.log("🌐 Browser executable:", browserExecutable ?? "remotion bundled (fallback)");
|
||||
|
||||
await renderMedia({
|
||||
composition: { ...composition, durationInFrames: effectiveDurationInFrames },
|
||||
serveUrl: bundleLocation,
|
||||
codec: "h264",
|
||||
outputLocation,
|
||||
inputProps,
|
||||
browserExecutable,
|
||||
chromiumOptions: {
|
||||
disableWebSecurity: true,
|
||||
ignoreCertificateErrors: true,
|
||||
|
||||
Reference in new issue
Block a user