Skip to content

Commit

Permalink
Update requirements.txt and fix issue when rendering video with subti…
Browse files Browse the repository at this point in the history
…tles

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.
  • Loading branch information
ZStack-Robot committed Sep 13, 2024
1 parent 4ba51ac commit 04dfc4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions funclip/videoclipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import moviepy.editor as mpy
from moviepy.video.tools.subtitles import SubtitlesClip, TextClip
from moviepy.editor import VideoFileClip, concatenate_videoclips
from moviepy.video.compositing import CompositeVideoClip
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
from utils.subtitle_utils import generate_srt, generate_srt_clip
from utils.argparse_tools import ArgumentParser, get_commandline_args
from utils.trans_utils import pre_proc, proc, write_state, load_state, proc_spk, convert_pcm_to_float
Expand Down Expand Up @@ -441,4 +441,4 @@ def main(cmd=None):


if __name__ == '__main__':
main()
main()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ librosa
soundfile
scikit-learn>=1.3.2
funasr>=1.1.2
moviepy
moviepy==1.0.3
numpy==1.26.4
gradio
modelscope
Expand Down

0 comments on commit 04dfc4e

Please sign in to comment.