From fe638b9895f0a1b59cb1b3956df88ad189ddfe47 Mon Sep 17 00:00:00 2001 From: Jacques Date: Thu, 22 Jan 2026 21:39:06 +0100 Subject: [PATCH] fix: reduce font size to 16, improve TTS sync (3 words/chunk, 0.3s/word) --- ffmpeg-service/main.py | 4 ++-- server/routes/reels.ts | 4 ++-- server/services/ffmpeg.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ffmpeg-service/main.py b/ffmpeg-service/main.py index 1d244c9..6e00ea8 100644 --- a/ffmpeg-service/main.py +++ b/ffmpeg-service/main.py @@ -117,7 +117,7 @@ def generate_simple_vtt(text: str, vtt_path: Path): for word in words: current_chunk.append(word) - if len(current_chunk) >= 5 or word.endswith((".", "!", "?", ":")): + if len(current_chunk) >= 3 or word.endswith((".", "!", "?", ":")): chunks.append(" ".join(current_chunk)) current_chunk = [] @@ -131,7 +131,7 @@ def generate_simple_vtt(text: str, vtt_path: Path): for i, chunk in enumerate(chunks): word_count = len(chunk.split()) - duration = word_count * 0.4 # 0.4 seconds per word + duration = word_count * 0.3 # 0.3 seconds per word (faster sync) start_time = format_vtt_time(current_time) end_time = format_vtt_time(current_time + duration) diff --git a/server/routes/reels.ts b/server/routes/reels.ts index 299f676..b81e838 100644 --- a/server/routes/reels.ts +++ b/server/routes/reels.ts @@ -185,7 +185,7 @@ reelsRouter.post('/reels/preview', async (req: Request, res: Response) => { ttsEnabled, ttsVoice, wordDuration = 0.6, - fontSize = 24, + fontSize = 16, musicVolume = 0.25, drawText = true, } = req.body; @@ -255,7 +255,7 @@ reelsRouter.post('/reels', async (req: Request, res: Response) => { pageIds, scheduledFor, wordDuration = 0.6, - fontSize = 24, + fontSize = 16, musicVolume = 0.25, drawText = true, } = req.body; diff --git a/server/services/ffmpeg.ts b/server/services/ffmpeg.ts index 9073a2f..c423a25 100644 --- a/server/services/ffmpeg.ts +++ b/server/services/ffmpeg.ts @@ -83,7 +83,7 @@ export class FFmpegService { tts_enabled: options.ttsEnabled, tts_voice: options.ttsVoice, word_duration: options.wordDuration ?? 0.6, - font_size: options.fontSize ?? 24, + font_size: options.fontSize ?? 16, music_volume: options.musicVolume ?? 0.25, draw_text: options.drawText ?? true, }; @@ -176,7 +176,7 @@ export class FFmpegService { tts_enabled: options.ttsEnabled, tts_voice: options.ttsVoice, word_duration: options.wordDuration ?? 0.6, - font_size: options.fontSize ?? 24, + font_size: options.fontSize ?? 16, music_volume: options.musicVolume ?? 0.25, draw_text: options.drawText ?? true, };