From 048b049e183a461e2bcfdd99369e49b20b0fef8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=87=AF?= Date: Tue, 23 Apr 2024 14:41:32 +0800 Subject: [PATCH] fix: FFSubtitle's srt format is not synchronized between subtitles and dubbing --- lib/node/subtitle.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/node/subtitle.js b/lib/node/subtitle.js index 8df73cb..4825841 100755 --- a/lib/node/subtitle.js +++ b/lib/node/subtitle.js @@ -309,12 +309,11 @@ class FFSubtitle extends FFNode { if (captions.length > 0) { forEach(captions, paragraph => { - const time = paragraph.duration / 1000; - const frames = start + time * fps; + const start = paragraph.start / 1000 * fps; + const frames = paragraph.end / 1000 * fps; const text = paragraph.text; console.log(text); this.textList.push({ start, frames, text, draw: false }); - start = frames; }); } else { forEach(list, text => {