diff --git a/ffmpeg-service/main.py b/ffmpeg-service/main.py index 2425b69..06bb78a 100644 --- a/ffmpeg-service/main.py +++ b/ffmpeg-service/main.py @@ -480,8 +480,8 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)): if has_tts: # Subtitles (TikTok style) using SRT (already generated in TTS block) print(f"🎬 Overlaying subtitles from TTS SRT: {tts_srt_path}") - # White color (&H00FFFFFF), Size 64, Black outline - style = f"FontName=DejaVu Sans,FontSize=64,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,BorderStyle=1,Outline=3,Shadow=0,Bold=1,Alignment=2,MarginV=250" + # White color (&H00FFFFFF), Size 30, Black outline + style = f"FontName=DejaVu Sans,FontSize=30,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,BorderStyle=1,Outline=3,Shadow=0,Bold=1,Alignment=2,MarginV=250" srt_path_str = str(tts_srt_path).replace("\\", "/").replace(":", "\\:") text_filter = f"subtitles='{srt_path_str}':force_style='{style}'" else: @@ -490,10 +490,10 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)): std_srt_path = job_dir / "std_text.srt" generate_simple_srt(request.text, std_srt_path) - # White color (&H00FFFFFF), Size 64, Black outline - style = f"FontName=DejaVu Sans,FontSize=64,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,BorderStyle=1,Outline=3,Shadow=0,Bold=1,Alignment=2,MarginV=250" + # White color (&H00FFFFFF), Size 30, Black outline + style = f"FontName=DejaVu Sans,FontSize=30,PrimaryColour=&H00FFFFFF,OutlineColour=&H00000000,BorderStyle=1,Outline=3,Shadow=0,Bold=1,Alignment=2,MarginV=250" srt_path_str = str(std_srt_path).replace("\\", "/").replace(":", "\\:") - text_filter = f"subtitles='{srt_path_str}':force_style='{style}'" + text_filter = f"subtitles='{std_srt_path}':force_style='{style}'" # Combine formatting + text video_filters_str += f",{text_filter}" diff --git a/task.md b/task.md index a6dc9bb..6b567aa 100644 --- a/task.md +++ b/task.md @@ -122,6 +122,8 @@ Ajout d'une fonctionnalité complète de création de Reels Facebook permettant - [x] **Refactor FFmpeg** : Passage à un pipeline `filter_complex` unifié pour éviter les conflits et garantir l'overlay. - [x] **Fix Indentation** : Correction de l'erreur de syntaxe Python introduite. - [x] **Fix F-String Syntax** : Correction de l'erreur `f-string expression part cannot include a backslash`. + - [x] **Final Robust Fix** : Switch complet vers le filtre `subtitles` et format `.srt` pour contourner l'absence de `drawtext` dans l'environnement. + - [x] **Style Adjustment** : Réduction de la taille du texte à 30 pour un rendu plus élégant. ## Progress Log