-
Notifications
You must be signed in to change notification settings - Fork 883
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
quiet mode for run_async method might cause ffmpeg process to stick. #195
Comments
The issue seems to be that pipe buffers are finite in size, so they fill up and eventually block. One workaround when running asynchronously is to just read() from the output pipes periodically. E.g., if you have a loop where you're feeding frames to stdin:
But this is a bit hacky and relies on ffmpeg not producing too much output to stderr in one frame. I'd like it if the |
same problem |
Same issue. |
Fix issue #195. Redirect stdout/err to /dev/null
I do not think this issue was fixed. I am still running into it myself. |
That's the reason why I am still using the modified ffmpeg-python of my own. :) |
Ahhh... Is that published to pypi? |
No. It is still a forked ffmpeg-python repo. And since I have been away from such stuff for a long time, it is out of date with the repo now. |
is this planned to be integrated? |
This workaround worked for me:
|
What I experienced
Recently, I was using this module in my project for decoding video into pipe as well as encoding target frames into a result video.
But I found that setting the parameter "quiet" of the encoder process to True (which set both stdout and stderr to PIPE) will cause the ffmpeg process to stick at some stage ( and in this case, I cannot write anything into its stdin). If I leave "quiet" to default or set both pipe_stdout and pipe_stderr to False, everything goes well.
What I tried
I tried to edit the run_async function, changing it from
to
Then, using this modified version of ffmpeg-python in my project, it works without any problems.
After all, I don't think this issue is solved, for it will stick again if setting either pipe_stdout or pipe_stderr (I confirmed).
My forked version works. Should I make a pull request? Or do it only when we find the real reason for this issue.
The text was updated successfully, but these errors were encountered: