-
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
ffmpeg hangs #13
Comments
I touched these files recently... when did you download the module ? Are you using Python 2 or Python 3 ? |
I downloaded maybe last week? Fairly recent. I'd love to use python 3 but the last time I looked it wasn't supported....so I'm using 2.7 |
Ok, so I didn't know that this bug existed in python 2.7, but people of If you could update and give it a try, that would be great ! Also it Le 15/02/2014 21:55, stewpend0us a écrit :
|
I installed using pip btw..and just tried an upgrade that told me it's up to date. Maybe I'm using an older version then I realized if whatever pip gives me isn't the latest. I'll download the source and give it a try... |
Did it work ? |
Haven't had a chance yet...I will test it out and let you know. |
Cool. there is no hurry ;) Le 19/02/2014 15:14, stewpend0us a écrit :
|
Alright pretty sure i'm running version 2.1.4.05 (if there's a way to do moviepy.version or something I can confirm that but it's definitely not the same code that I was running before.) Same issue. Hangs at frame 166. I didn't see any reason not to close stdin in ffmpeg_reader or stdout and stderr in ffmpeg_writer so I tried that and it still hung. When I add stderr to the list on ffmpeg_reader it works again.... |
I have the same issue after 6 minutes of every rendering. I hope this helps fixing the problem for anyone else. |
Thanks for the feedback. I think it's pretty clear now that I have no idea what is going on. It seems to always work on my computer but whatever I do its buggy on other distributions. Could you please make a commit with the correction ? Thanks in advance ! |
…lose() to initialization.
Hopefully fixes issue #13 for everyone.
I changed this in the last versions. I think closing the error pipe was not the best way to proceed, so now the error pipe is redirected towards devnull or towards some file . It's all a little technical but I expect that this should not cause any problem. When you have time / If you are still interested , can you try the latest version on Github and tell me if it works ? I yes I can close that issue. Thanks in advance ! |
HI there, sorry for the very late reply. I totally forgot to write back. I tested your patch with my project twice, and id crashed both times as before. The chances are great that its OS dependent. As long as people find this thread, they should be able to work around this problem. Another workaround would be, if you add a switch to the class to deactivate it. Have a nice easter, oxivanisher |
Ok, thanks. Just to be sure: did you try with a recent version of MoviePy, or was it just at the time ? What is your OS ? |
I checked the sourcecode (pip) and it was the "corrent" one at this time. But i will gladly test it again and make sure. I use Debian Wheezy x64 and a downloaded version of ffmpeg. I will test it today or tomorrow and leave a comment here. |
It is looking good! 👍 It is already rendering for 18 minutes and all the other times it crashed after 6 minutes. I will let it run for another 12 minutes to surely reach 30 minutes. I thing we would be safe after that. :D Very nice work. |
I let it finish the run and it worked perfectly for over 70 minutes. I think its save to close this issue for good. 👍 |
That's a relief, thanks for testing. For info, one of the things I have changed is that now the pipes for the output or the errors returned by FFMPEG are now redirected either towards a file or towards "DEVNULL" (which, if I understood well, is where you send the unwanted streams). I am curious, your processes seem a little long, what is your frame writing rate (i.e. when you launch to_videofile, it should print something like "XXX iters/sec", what is XXX ?) |
It is around 25. I overlayed clips with Images (fade in, and then out again) over a FullHD Video recording with audio. The output file was rendered to 720p (it wanted to take 16+ hours). My system has 16GB RAM and a 8 Core CPU, but i played around with multithreading (added the option to the FFMPEG call) but it did not go faster. Its an Athlon "Don't know what exactly" with 3.4 GHz per core. |
Ok, everything fine then, I am closing this issue. |
I was using:
"from moviepy.video.io.ffmpeg_writer import FFMPEG_VideoWriter as FFW"
and
"from moviepy.video.io.ffmpeg_reader import FFMPEG_VideoReader as FFR"
To read a video, rotate the frame, and save it to a new video. (I'm sure there's an easier way to do that using your tool...but anyway)
ffmpeg would consistently hang after about 200 frames. I got it working by adding:
self.proc.stdout.close()
self.proc.stderr.close()
to the end of init in ffmpeg_writer.py
and
self.proc.stdin.close()
self.proc.stderr.close()
to the end of initialize() in ffmpeg_reader.py
based on the comments here:
http://stackoverflow.com/questions/16523746/ffmpeg-hangs-when-run-in-background
The video I was reading/writing is 1920x1080, 50seconds, ~20606kbps, 29fps, .mov file
and I'm using windows 7 if that matters.
The text was updated successfully, but these errors were encountered: