Skip to content

Commit

Permalink
Merge pull request #461 from harry0703/dev
Browse files Browse the repository at this point in the history
Optimize memory usage in moviepy
  • Loading branch information
harry0703 authored Jul 25, 2024
2 parents 84ae8e5 + 931e1a0 commit 6512e3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def save_config():
"project_description",
"<a href='https://github.com/harry0703/MoneyPrinterTurbo'>https://github.com/harry0703/MoneyPrinterTurbo</a>",
)
project_version = _cfg.get("project_version", "1.1.9")
project_version = _cfg.get("project_version", "1.2.0")
reload_debug = False

imagemagick_path = app.get("imagemagick_path", "")
Expand Down
2 changes: 2 additions & 0 deletions app/services/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ def create_text_clip(subtitle_item):
fps=30,
)
video_clip.close()
del video_clip
logger.success("completed")


Expand Down Expand Up @@ -342,6 +343,7 @@ def preprocess_video(materials: List[MaterialInfo], clip_duration=4):
video_file = f"{material.url}.mp4"
final_clip.write_videofile(video_file, fps=30, logger=None)
final_clip.close()
del final_clip
material.url = video_file
logger.success(f"completed: {video_file}")
return materials
Expand Down
4 changes: 2 additions & 2 deletions webui/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"You can download the generated video from the following links": "你可以从以下链接下载生成的视频",
"Basic Settings": "**基础设置** (:blue[点击展开])",
"Language": "界面语言",
"Pexels API Key": "Pexels API Key ([点击获取](https://www.pexels.com/api/))",
"Pixabay API Key": "Pixabay API Key ([点击获取](https://pixabay.com/api/docs/#api_search_videos))",
"Pexels API Key": "Pexels API Key ([点击获取](https://www.pexels.com/api/)) :red[推荐使用]",
"Pixabay API Key": "Pixabay API Key ([点击获取](https://pixabay.com/api/docs/#api_search_videos)) :red[可以不用配置,如果 Pexels 无法使用,再选择Pixabay]",
"LLM Provider": "大模型提供商",
"API Key": "API Key (:red[必填,需要到大模型提供商的后台申请])",
"Base Url": "Base Url (可选)",
Expand Down

0 comments on commit 6512e3f

Please sign in to comment.