mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
feat: Add Remotion video rendering API with TTS integration and configure Docker to use system Chromium for rendering.
This commit is contained in:
1 parent
d97c0ed73a
commit
468e65091f
2 files changed
+10
-5
No files matched your search
+5
-2
@@ -73,8 +73,11 @@ RUN rm -rf client/node_modules \
|
||||
# Pré-bundler la composition Remotion pendant le build (speedup au premier rendu)
|
||||
RUN node scripts/prebundle-remotion.js || true
|
||||
|
||||
# S'assurer que le binaire browser de Remotion est téléchargé et disponible
|
||||
RUN npx remotion browser ensure
|
||||
# Vérifier que le binaire Chromium système est bien présent (utilisé à la place du binaire Remotion)
|
||||
# Note: npx remotion browser ensure télécharge un binaire glibc qui ne fonctionne pas sur Alpine (musl)
|
||||
RUN which chromium-browser && echo "✓ chromium-browser trouvé à $(which chromium-browser)" || \
|
||||
(which chromium && echo "✓ chromium trouvé à $(which chromium)") || \
|
||||
echo "⚠ Aucun chromium système trouvé — le rendu échouera"
|
||||
|
||||
|
||||
# Exposer le port de l'application
|
||||
|
||||
@@ -171,9 +171,10 @@ 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, Debian/Ubuntu at /usr/bin/chromium-browser
|
||||
const chromiumPaths = ["/usr/bin/chromium", "/usr/bin/chromium-browser"];
|
||||
// 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));
|
||||
console.log("🌐 Browser executable:", browserExecutable ?? "remotion bundled (fallback)");
|
||||
|
||||
await renderMedia({
|
||||
composition: { ...composition, durationInFrames: effectiveDurationInFrames },
|
||||
@@ -184,7 +185,8 @@ remotionRouter.post("/render", upload.array("images", 4), async (req, res) => {
|
||||
browserExecutable,
|
||||
chromiumOptions: {
|
||||
disableWebSecurity: true,
|
||||
}
|
||||
ignoreCertificateErrors: true,
|
||||
},
|
||||
});
|
||||
|
||||
console.log("✅ Render completed:", outputFilename);
|
||||
|
||||
Reference in new issue
Block a user