Skip to content
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

Support for gracefully exiting ffmpeg #1001

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jbcpollak
Copy link

If you exit ffmpeg sending it the 'q' key, it will exit with status code 0, but if you send it SIGINT it exits with 255 and if you send it SIGTERM it exits with 147. (from versions of ffmpeg 4.1-4.2)

In all cases it seems to shutdown gracefully, however the second two trigger the 'error' event in fluent-ffmpeg, and when I checked, the error codes from ffmpeg were not documented and not encouraged to be used in scripting.

I added an FfmpegCommand.quit() to gracefully exit by sending the 'q' key to ffmpeg and wrote a unit test to verify it functions. I also verified in my own application this works as expected and does not produce errors.

It would be great if this could be merged and a new version published to npmjs - it seems the current version on the repo lags quite a bit from a lot of bug fixes.

@wyattzheng
Copy link

agree

@chrisspiegl
Copy link

This would be great, especially since the last release is years ago 🙈 and there are a lot of additions missing.

@chrisspiegl
Copy link

Adding, I installed your branch in my latest project and used the quit() successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants