Skip to content

Commit 04dfc4e

Browse files
committed
Update requirements.txt and fix issue when rendering video with subtitles
In moviepy version 1.0.3, CompositeVideoClip is a module within moviepy.video.compositing. To use it correctly, we need to import the CompositeVideoClip class from the module. This commit makes the following changes: - Update the import statement for CompositeVideoClip in videoclipper.py to import the class from the module. - Fix the moviepy version to 1.0.3 in requirements.txt to avoid unexpected behavior due to version upgrades. These changes resolve the issue encountered when rendering videos with subtitles using moviepy 1.0.3.
1 parent 4ba51ac commit 04dfc4e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

funclip/videoclipper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import moviepy.editor as mpy
1717
from moviepy.video.tools.subtitles import SubtitlesClip, TextClip
1818
from moviepy.editor import VideoFileClip, concatenate_videoclips
19-
from moviepy.video.compositing import CompositeVideoClip
19+
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
2020
from utils.subtitle_utils import generate_srt, generate_srt_clip
2121
from utils.argparse_tools import ArgumentParser, get_commandline_args
2222
from utils.trans_utils import pre_proc, proc, write_state, load_state, proc_spk, convert_pcm_to_float
@@ -441,4 +441,4 @@ def main(cmd=None):
441441

442442

443443
if __name__ == '__main__':
444-
main()
444+
main()

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ librosa
22
soundfile
33
scikit-learn>=1.3.2
44
funasr>=1.1.2
5-
moviepy
5+
moviepy==1.0.3
66
numpy==1.26.4
77
gradio
88
modelscope

0 commit comments

Comments
 (0)