-
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
Zombie processes after reader.close() #164
Comments
What do you mean by "after rendering" ? Even after the python session is closed ? If you still have VideoFileClips around it is normal that their processes are still there. Do you destroy the VideoFileClips ? One thing I generally do is encapsulate the whole rendering process inside a function. This way all the clips are destroyed when we leave the function and there are no preocesses left. Tell me if this didn't answer your question. |
My MoviePy code is executed by a Celery task send from a Django view. So as long as the parent process lives (in this case Celery) the ffmpeg processes will stay alive. (without using resources though) I explicitly call |
I see that they get reused when compiling another video. So it's actually not so bad. |
That's strange. Are you reusing some clips in common in your different requests ? |
svleeuwen, |
@alesgenova: I was under pressure to finish the project so I just watched the processes and killed them if they stayed around for too long. But did you try @mbeacom's fix above? |
Yes, I gave that a shot, but it didn't solve it completely, it was still unreliable. |
Ah, now I remember. I also used |
@alesgenova It's odd that you're still experiencing |
Fix #164 - Resolve ffmpeg zombie processes
@svleeuwen @alesgenova Please pull an update from master directly and let me know if you're still experiencing this issue. Hopefully we'll be able to merge the update to PyPi soon. |
I'm still experiencing this issue, even with trying all the solutions in this thread. I'm using the master branch currently, Python 2.7, and Windows 10. Any other ideas to force close the FFMPEG processes? My end goal is to delete some of the source video files after the render is complete, but I'm getting Error 32 since FFMPEG still has control of those files. Using reader.close() on the various clips does exit out some of the FFMPEG processes but I can't get all of them for some reason. If there is the audio clip equivalent of reader.close() maybe that would solve the issue. Edit: Also, even though I'm able to use close() for video clips and close_proc() for audio, there's still one FFMPEG process left. I have no idea where it comes from or how to close it manually. |
Hi, |
Thanks @Mordokkai, I did something a little different because del() didn't seem to work for me. I figured out recently that the audio portion of the clip also has a reader you can close, but the function is named differently from the video reader. Call both these on the clip you need to take control of: |
Yes, sorry, soon after I sent my answer, I realized that my solution raised other issues (about missing attributes). I tried to fix it but I didn't succeed. I finally used |
This is a note to the developers of moviepy (which also includes myself)).. We probably need to modify the close_proc function so that it matches the video reader class and rename the function to close. |
Hey there... just wanted to check in and see if this issue is being worked on... I am not an expert in processes.. but getting zombie processes running a subprocess to split audio from a movie file. |
I use this function to close my video clips and it works for me. There is probably a better solution, and maybe this issue was fixed since april.
|
I'm still running into this issue.- I'm trying to render about 100 videos (each one consists of several VideoFileClip subclips), but each time I render 5 videos or so, I get the "Handle is Invalid" error. I've had to restart & clear my Jupyter kernel after every 4-5 videos I make. |
@Mordokkai 's solution worked for me. I just call that function after every clip is used. |
Readers were being left behind on Windows only. Known issue with MoviePy: Zulko/moviepy#164
Today I got error:
|
Thanks |
I am still having this issue, is there any known fix? I am closing every single clip/video in my program. |
I was about to remove moviepy as a dependency then saw your solution and it worked. Thanks buddy |
If anyone is still having this issue now (especially with any Audio/VideoFileClip) when trying to delete any tmp files, please try this function. tmp_dir is the path with all your files you wish to delete, and the audio_file_clip is any Audio/VideoFileClip object that is holding you back in life.
|
Hi,
When MoviePy finishes rendering I'm still left with a lot of zombie ffmpeg processes. (http://cl.ly/image/1X2h0o0J103K)
These don't use any resources, but there is a maximum nr of processes ofcourse.
Is this bad? Can this be overcome?
The text was updated successfully, but these errors were encountered: