imageio-ffmpeg: Race condition: We had to kill ffmpeg to stop it.
I’m trying to encode several mp4
s at a time, and all of the larger ones give me the message We had to kill ffmpeg to stop it.
Most of the files for which this message is printed are corrupted. Looking at the code, there appears to be a race condition in there where it only gives ffmpeg
2.5s to clean up. Is this needed? Or is there a way to disable that?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 39 (17 by maintainers)
A new release is now available on Pypi.
agreed.
I re-posted because someone requested a workaround, which typically aren’t long-term solutions. This can be added without waiting for a PR to get approved, merged, released and posted.
Nevermind, I got the test to pass (see #14) by forcing the dtype to uint8.
Ok I can add this and make a PR. Would
timeout
be a little too generic? Maybeffmpeg_timeout
?Simple modification to the included
imageio-ffmpeg
tests to reproduce:NB: Only included
numpy
because generating the required random bytes withrandom
in a list comprehension was much too slow!This also highlights that the issue depends on having non-uniform data in the frames, which presumably causes
ffmpeg
to spend longer in the encoding…I’ve just run into this issue in a pretty lightweight scenario (low frame count -
35
, but large input frame size of2048x2048
).I upped the timeout to 10s, during which
ffmpeg
closed normally.This is on the following machine
It is not a particularly low-spec machine (8 cores, 32GB RAM).