-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-core CPU rendering #584
Comments
try setting the threads argument in the write_videofile function.
|
@Earney threads argument won't force the action to use more machine cores. It doesn't speed up the write file proccess, even I tried "threads=100". |
As I understand it, the thread argument should make ffmpeg use several threads, which your OS may dispatch on several processors. However, it is possible that your bottleneck is the generation of the frames, and not the encoding. If moviepy's frame generation (which is single-threaded if I remember well) is slower than the encoding, then ffmpeg will only require a single thread, even when several are provided. Not sure if this applies to your case ? |
^ I added a proof of concept multithreading support, albeit a bit gimmicky it appears to be working. |
@Zulko Will multithreading work on Windows? I think it works only on Linux due to the Python GIL. |
Hi guys, in the past I was same problem and I solved that. You need to use this command in your code ONLY one time.
and export the video:
while the video is export, moviepy will use all your cores. Hope I helped :) |
Closing this older issue with a link to this Moviepy Roadmap comment regarding (potential future) multithreading support. |
@idan92 |
When I render my MoviePy video on ubuntu it uses only one core of the machine.
As per below thread , ffmpeg supports multiprocessor based on codec ( http://www.ffmpeg-archive.org/FFMPEG-on-multiprocessor-machine-td935307.html )
Is there a way this can be leveraged ?
The text was updated successfully, but these errors were encountered: