mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-23 23:18:12 +02:00
style(ffmpeg): reduce font size to 30 for cleaner text overlay
This commit is contained in:
1 parent
3d15a2e1f6
commit
b33c9a30be
2 files changed
+7
-5
No files matched your search
@@ -480,8 +480,8 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)):
|
|||||||
if has_tts:
|
if has_tts:
|
||||||
# Subtitles (TikTok style) using SRT (already generated in TTS block)
|
# Subtitles (TikTok style) using SRT (already generated in TTS block)
|
||||||
print(f"🎬 Overlaying subtitles from TTS SRT: {tts_srt_path}")
|
print(f"🎬 Overlaying subtitles from TTS SRT: {tts_srt_path}")
|
||||||
# White color (&H00FFFFFF), Size 64, Black outline
|
# White color (&H00FFFFFF), Size 30, 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"
|
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(":", "\\:")
|
srt_path_str = str(tts_srt_path).replace("\\", "/").replace(":", "\\:")
|
||||||
text_filter = f"subtitles='{srt_path_str}':force_style='{style}'"
|
text_filter = f"subtitles='{srt_path_str}':force_style='{style}'"
|
||||||
else:
|
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"
|
std_srt_path = job_dir / "std_text.srt"
|
||||||
generate_simple_srt(request.text, std_srt_path)
|
generate_simple_srt(request.text, std_srt_path)
|
||||||
|
|
||||||
# White color (&H00FFFFFF), Size 64, Black outline
|
# White color (&H00FFFFFF), Size 30, 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"
|
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(":", "\\:")
|
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
|
# Combine formatting + text
|
||||||
video_filters_str += f",{text_filter}"
|
video_filters_str += f",{text_filter}"
|
||||||
|
|||||||
@@ -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] **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 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] **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
|
## Progress Log
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user