Skip to content

Commit 4ba51ac

Browse files
committed
bug fix for en mode
1 parent f81c675 commit 4ba51ac

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

funclip/test/imagemagick_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from moviepy.editor import *
2-
from moviepy.video.tools.subtitles import SubtitlesClip
2+
from moviepy.video.tools.subtitles import SubtitlesClip, TextClip
3+
from moviepy.editor import VideoFileClip, concatenate_videoclips
4+
from moviepy.video.compositing import CompositeVideoClip
35

46
generator = lambda txt: TextClip(txt, font='./font/STHeitiMedium.ttc', fontsize=48, color='white')
57
subs = [((0, 2), 'sub1中文字幕'),

funclip/videoclipper.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
import soundfile as sf
1515
from moviepy.editor import *
1616
import moviepy.editor as mpy
17-
from moviepy.video.tools.subtitles import SubtitlesClip
17+
from moviepy.video.tools.subtitles import SubtitlesClip, TextClip
18+
from moviepy.editor import VideoFileClip, concatenate_videoclips
19+
from moviepy.video.compositing import CompositeVideoClip
1820
from utils.subtitle_utils import generate_srt, generate_srt_clip
1921
from utils.argparse_tools import ArgumentParser, get_commandline_args
2022
from utils.trans_utils import pre_proc, proc, write_state, load_state, proc_spk, convert_pcm_to_float
@@ -198,8 +200,9 @@ def video_clip(self,
198200
else:
199201
offset_b, offset_e = 0, 0
200202
log_append = ""
203+
# import pdb; pdb.set_trace()
201204
_dest_text = pre_proc(_dest_text)
202-
ts = proc(recog_res_raw, timestamp, _dest_text)
205+
ts = proc(recog_res_raw, timestamp, _dest_text.lower())
203206
for _ts in ts: all_ts.append([_ts[0]+offset_b*16, _ts[1]+offset_e*16])
204207
if len(ts) > 1 and match:
205208
log_append += '(offsets detected but No.{} sub-sentence matched to {} periods in audio, \

0 commit comments

Comments
 (0)