mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-15 19:29:03 +02:00
feat: Implement FastAPI service for video processing with advanced TTS generation and word-level synchronized subtitles.
This commit is contained in:
1 parent
64969b17b5
commit
5a8c548a62
1 file changed
+14
-6
+14
-6
@@ -862,12 +862,20 @@ async def process_reel(request: ReelRequest, x_api_key: str = Header(None)):
|
||||
|
||||
if has_watermark:
|
||||
if request.store_name:
|
||||
# Ouro Party Mode
|
||||
# 1. Scaling the logo large for the center
|
||||
fc_parts.append(f"[{watermark_idx}:v]scale=-1:300[wm]")
|
||||
# 2. Placing it in the center, and fading it IN during the last 5 seconds
|
||||
v_chain += f"[v_pre_wm];[v_pre_wm][wm]overlay=(W-w)/2:(H-h)/2-100:enable='between(t,{logo_start_time},{video_duration})'"
|
||||
# 3. Drawing the Store Name below the logo using ASS subtitles instead of drawtext!
|
||||
# Ouro Party Mode + Persistent bottom right
|
||||
|
||||
# We need two scaled versions of the logo
|
||||
# [wm_small]: Bottom right persistent logo
|
||||
fc_parts.append(f"[{watermark_idx}:v]scale=200:-1,split=2[wm_small_base][wm_large_base]")
|
||||
fc_parts.append(f"[wm_large_base]scale=-1:300[wm_large]")
|
||||
|
||||
# 1. Place small logo in bottom right throughout the whole video
|
||||
v_chain += "[v_pre_small];[v_pre_small][wm_small_base]overlay=W-w-20:H-h-20"
|
||||
|
||||
# 2. Place large logo in the center, and fading it IN during the last 5 seconds
|
||||
v_chain += f"[v_pre_large];[v_pre_large][wm_large]overlay=(W-w)/2:(H-h)/2-100:enable='between(t,{logo_start_time},{video_duration})'"
|
||||
|
||||
# 3. Drawing the Store Name below the logo using ASS subtitles
|
||||
outro_ass_path = job_dir / "outro.ass"
|
||||
generate_outro_ass(
|
||||
request.store_name, outro_ass_path, logo_start_time, video_duration
|
||||
|
||||
Reference in new issue
Block a user