harry0703 / MoneyPrinterTurbo

利用AI大模型,一键生成高清短视频 Generate short videos with one click using AI LLM.
MIT License
14.79k stars 2.27k forks source link

How to make better use of multiple cores for video merging? #404

Closed UserItaly closed 4 weeks ago

UserItaly commented 1 month ago

I noticed it uses only 1-2% of my CPU (24 cores / 48 threads), and for a 1-minute video, it takes 30 minutes, with 27-28 minutes spent just on the last 2 stages where the videos are merged using ffmpeg. How can I make it use more cores? Which part of the code do I need to modify?

Additionally, are there any settings that can be modified to speed it up further?

harry0703 commented 4 weeks ago

On line 16 of the app/services/task.py code file, modify the n_threads parameter of params, for example, set params.n_threads=10 to use more threads for parallel processing. This will increase CPU utilization.