feat: Implement new Reel creation functionality with dedicated mobile and desktop UIs, server-side API routes, and a new FFmpeg processing service.

This commit is contained in:
Michael committed 2026-03-19 14:51:16 +01:00
1 parent ae0048a6e1
commit 3a5acd425c
5 files changed
+42 -2

No files matched your search

+6
View File
@@ -302,6 +302,7 @@ reelsRouter.post('/reels/preview', async (req: Request, res: Response) => {
musicVolume = 0.25,
drawText = true,
stabilize = false,
enableEndingEffect = true,
} = req.body;
// Récupérer le média vidéo
@@ -360,6 +361,7 @@ reelsRouter.post('/reels/preview', async (req: Request, res: Response) => {
drawText,
stabilize,
watermarkUrl,
enableEndingEffect,
});
if (!result.success) {
@@ -471,6 +473,7 @@ async function processReelBackground(
musicVolume?: number;
drawText?: boolean;
stabilize?: boolean;
enableEndingEffect?: boolean;
},
storeName?: string
) {
@@ -489,6 +492,7 @@ async function processReelBackground(
musicVolume,
drawText,
stabilize,
enableEndingEffect,
} = data;
console.log(`🔄 [Background] Starting processing for Post ${postId}`);
@@ -570,6 +574,7 @@ async function processReelBackground(
stabilize,
watermarkUrl,
storeName,
enableEndingEffect,
});
console.log(`⏱️ [Background] FFmpeg took ${(Date.now() - startTime) / 1000}s`);
@@ -728,6 +733,7 @@ reelsRouter.post('/reels', async (req: Request, res: Response) => {
musicVolume = 0.25,
drawText = true,
stabilize = false,
enableEndingEffect = true,
} = req.body;
// Validation immédiate
+5
View File
@@ -20,6 +20,7 @@ interface FFmpegReelRequest {
stabilize?: boolean; // Stabilisation vidéo via vidstab (default: false)
watermark_url?: string; // URL du logo
store_name?: string; // Nom du magasin pour l'outro
enable_ending_effect?: boolean; // Activer l'effet de fin (logo+fondu)
}
interface FFmpegReelResponse {
@@ -77,6 +78,7 @@ export class FFmpegService {
stabilize?: boolean;
watermarkUrl?: string;
storeName?: string;
enableEndingEffect?: boolean;
} = {}
): Promise<{ success: boolean; videoBase64?: string; duration?: number; error?: string }> {
const config = this.ensureConfigured();
@@ -95,6 +97,7 @@ export class FFmpegService {
stabilize: options.stabilize ?? false,
watermark_url: options.watermarkUrl,
store_name: options.storeName,
enable_ending_effect: options.enableEndingEffect ?? true,
};
// Remove undefined values
@@ -176,6 +179,7 @@ export class FFmpegService {
stabilize?: boolean;
watermarkUrl?: string;
storeName?: string;
enableEndingEffect?: boolean;
} = {}
): Promise<{ success: boolean; videoBase64?: string; duration?: number; error?: string }> {
const config = this.ensureConfigured();
@@ -194,6 +198,7 @@ export class FFmpegService {
stabilize: options.stabilize ?? false,
watermark_url: options.watermarkUrl,
store_name: options.storeName,
enable_ending_effect: options.enableEndingEffect ?? true,
};
// Remove undefined values