-
Notifications
You must be signed in to change notification settings - Fork 53
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
Keyboard interrupt not working on Windows #52
Comments
KeyboardInterrupt.movIt seems working on my environment:
(The response time seems to be a bit slow. A Keyboard Interrupt occurs 1-2 seconds after pressing Control C.) |
Interesting, I wonder if there is something else going on in my environment -- I do have multiple thread pools running (multiple ffmpeg in parallel with progress). I have not seen keyboard interrupt work on Windows 10 or 11 with python 3.11. |
Wondering if this is related to this issue as my ffmpeg is infinitely hanging unless I press ENTER on my keyboard. Then it continues. Progress(frame=0, fps=0.0, size=2400256, time=datetime.timedelta(seconds=11), bitrate=1745.1, speed=1860.0) If instead of ENTER I hit CTRL+C the code is hanging at the same location. done, pending = concurrent.futures.wait(futures, return_when=concurrent.futures.FIRST_EXCEPTION) And oddly enough if I run my same code through PyTest it never hangs. Edit: Seems to be related to issuing the exact same command with the same files. My Pytest suite was handling multiple different files but running the code from my main function was trying to handle the same file. No ffmpeg process was still running still. Just issuing a different command to call ffmpeg again seems to fix the issue with whatever process (that I can't see listed anywhere) is holding the files and hanging ffmpeg. No idea why hitting ENTER fixed it either though. I'd guess its something with windows and how this library is handling the pass off to ffmpeg. Edit2: Having pyautogui.press('enter') even stops the hang if I connect to ffmpeg.on("progress"). Very odd behavior. |
It's just a guess but it sounds like ffmpeg is waiting for input from you.
I'd suggest trying ffmpeg options of "-y" (answer yes to any questions) and
possibly "-nostdin".
|
Hello,
I have found that keyboard interrupt does not work on Windows (I haven't tested it on other platforms).
What I found is that
concurrent.futures.wait()
does not return on the keyboard interrupt, making it necessary to introduce a timeout so the system can process the exception.In
ffmpeg.py
execute()
I tried changing:to:
With that change, keyboard interrupt works as expected.
The text was updated successfully, but these errors were encountered: