mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-12 01:36:54 +02:00
feat: Add Remotion video rendering endpoint with image and TTS support, and enhance Dockerfile's Chromium detection logic.
This commit is contained in:
1 parent
468e65091f
commit
fa4e6e3131
2 files changed
+20
-7
No files matched your search
@@ -171,9 +171,17 @@ remotionRouter.post("/render", upload.array("images", 4), async (req, res) => {
|
||||
|
||||
console.log("🎬 Rendering media...", effectiveDurationInFrames, "frames");
|
||||
|
||||
// Standard Chromium paths — Alpine installs at /usr/bin/chromium-browser, Debian/Ubuntu may differ
|
||||
const chromiumPaths = ["/usr/bin/chromium-browser", "/usr/bin/chromium"];
|
||||
const browserExecutable = chromiumPaths.find(p => fs.existsSync(p));
|
||||
// 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({
|
||||
|
||||
Reference in new issue
Block a user