From eee6e65c9411940de7fd9f15f4e42b9ec7b0740f Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Thu, 29 Jan 2026 12:20:12 +0100 Subject: [PATCH] fix: tune encoded stabilization for aggressive handheld shake --- ffmpeg-service/main.py | 9 +++++++-- task.md | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ffmpeg-service/main.py b/ffmpeg-service/main.py index cdf3cd2..41d30fa 100644 --- a/ffmpeg-service/main.py +++ b/ffmpeg-service/main.py @@ -443,13 +443,17 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)): transforms_path = job_dir / "transforms.trf" # Run detection pass + # Aggressive stabilization settings: + # - shakiness=10: Max sensitivity to shake + # - accuracy=15: High accuracy + # - stepsize=32: Larger search window for bigger shakes detect_cmd = [ "ffmpeg", "-y", "-i", str(input_video_path), "-vf", - f"vidstabdetect=stepsize=6:shakiness=8:accuracy=9:result={transforms_path}", + f"vidstabdetect=stepsize=32:shakiness=10:accuracy=15:result={transforms_path}", "-f", "null", "-", @@ -466,7 +470,8 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)): # We will add vidstabtransform to the video chain below # optzoom=2 -> Adaptive zoom to avoid black borders # zoom=0 -> Auto zoom - vidstab_filter = f"vidstabtransform=input={transforms_path}:smoothing=10:optzoom=2:zoom=0:interpol=bicubic,unsharp=5:5:0.8:3:3:0.4," + # smoothing=30 -> Heavy smoothing (default is 10) for handheld feel + vidstab_filter = f"vidstabtransform=input={transforms_path}:smoothing=30:optzoom=2:zoom=0:interpol=bicubic,unsharp=5:5:0.8:3:3:0.4," else: print( f"⚠️ Stabilization Pass 1 failed: {detect_proc.stderr.decode()[:500]}" diff --git a/task.md b/task.md index bf7cd75..1e95fa2 100644 --- a/task.md +++ b/task.md @@ -110,6 +110,8 @@ Ajout d'une fonctionnalité complète de création de Reels Facebook permettant - [x] FFmpeg: Profil H.264 High, 30fps et bitrate 10Mbps - [x] Frontend: Ajouter toggle Stabilisation et Qualité - [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] **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