From 817bd2a9805843c18eca06187c9c198ffc0831fb Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Thu, 29 Jan 2026 12:58:53 +0100 Subject: [PATCH] feat: emoji support in subtitles and clear stabilization UI --- client/src/pages/mobile/new-reel.tsx | 5 ++--- ffmpeg-service/main.py | 26 +++++++++++++++++++++----- task.md | 2 ++ 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/client/src/pages/mobile/new-reel.tsx b/client/src/pages/mobile/new-reel.tsx index 7856822..d2eaf27 100644 --- a/client/src/pages/mobile/new-reel.tsx +++ b/client/src/pages/mobile/new-reel.tsx @@ -84,7 +84,6 @@ export default function MobileNewReel() { const [isPlaying, setIsPlaying] = useState(null); const [musicOffset, setMusicOffset] = useState(0); const [stabilize, setStabilize] = useState(true); // Activé par défaut pour les Reels - const [force1080p, setForce1080p] = useState(true); // Activé par défaut const { data: pages = [] } = useQuery({ @@ -277,9 +276,9 @@ export default function MobileNewReel() {
- Stabilisation & Qualité 1080p + Stabilisation Vidéo (Anti-tremblements)
-
Application automatique après capture
+
Corrige les secousses (Recommandé main levée). Désactiver sur trépied.
str: async def generate_tts_with_subs( - text: str, voice: str, audio_path: Path, ass_path: Path + text: str, + voice: str, + audio_path: Path, + ass_path: Path, + display_text: Optional[str] = None, ): """Generate TTS audio with subtitles, with retry and fallback voices.""" import asyncio @@ -185,7 +189,11 @@ async def generate_tts_with_subs( audio_duration = None # Generate a high-quality ASS file with sync - generate_simple_ass(text, ass_path, total_duration=audio_duration) + # Use display_text (with emojis) if provided, otherwise standard text + text_to_display = display_text if display_text else text + generate_simple_ass( + text_to_display, ass_path, total_duration=audio_duration + ) print(f"✅ TTS success with voice: {attempt_voice}") return # Success! @@ -410,8 +418,13 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)): if tts_clean_text: print(f"🔊 Generating TTS audio to: {tts_audio_path}") + # Pass original text (with emojis) for subtitles, cleaned text for audio await generate_tts_with_subs( - tts_clean_text, voice, tts_audio_path, tts_ass_path + tts_clean_text, + voice, + tts_audio_path, + tts_ass_path, + display_text=request.text, ) # Verify files were created @@ -421,7 +434,7 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)): ) has_tts = True else: - print(f"❌ TTS audio file missing or empty!") + print("❌ TTS audio file missing or empty!") else: print("⚠️ TTS text is empty after cleaning, skipping.") except Exception as e: @@ -739,7 +752,10 @@ async def preview_tts(request: ReelRequest, x_api_key: str = Header(None)): elif not voice or "Neural" not in voice: voice = "fr-FR-VivienneMultilingualNeural" - await generate_tts_with_subs(clean_text, voice, tts_audio_path, tts_srt_path) + # Pass original text for subtitles (implied in SRT for preview too if needed, though mostly audio) + await generate_tts_with_subs( + clean_text, voice, tts_audio_path, tts_srt_path, display_text=request.text + ) if not tts_audio_path.exists(): raise Exception("TTS generation failed (file missing)") diff --git a/task.md b/task.md index 1e95fa2..9e2b49b 100644 --- a/task.md +++ b/task.md @@ -112,10 +112,12 @@ Ajout d'une fonctionnalité complète de création de Reels Facebook permettant - [x] Fix: Synchronisation parfaite Texte/Voix (TTS dynamique) - [x] Fix: Stabilisation optimisée (Zoom adaptatif + Single Pass) - [x] Amélioration: Stabilisation Aggressive (Smoothing 30, Shakiness 10) + - [x] Fix: Emojis supportés dans le texte (mais ignorés par TTS) - [x] **Phase 11: Clarification UX Mobile** ✅ - [x] Modifier l'alerte iOS pour prévenir que les réglages se font après - [x] Ajouter une flèche ou une animation pour attirer l'œil sur le Switch de stabilisation - [x] S'assurer que le bouton "Suivant" est bien visible sous le Switch + - [x] Renommer toggle stabilisation pour clarté (Anti-tremblements) - [x] **Phase 12: Optimisation Safari (Bypass Compression)** ✅ - [x] Ajouter l'attribut `multiple` à l'input file pour forcer l'envoi du fichier original (Bypass Safari downscaling) - [x] Mettre à jour les MIME types pour inclure `video/quicktime` (iPhone natif)