-
Notifications
You must be signed in to change notification settings - Fork 81
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
Expose the pid
to be able to kill the process manually.
#383
Comments
Have you checked force stop example? |
I'm using it, but even calling it sometimes doesn't stop the process. |
Sometimes? Could you be more specific? Does force stop work in case you described in this issue? |
The messages when the force is called, are being shown, however, when I check the processes the ffmpeg execution is still there. I'm running with |
Could you post debug logs? For that you need to configure both ffmpeg log level and java log level (logback or whatever you use) |
Peek.2023-12-26.16-34-working.mp4
Peek.2023-12-26.16-33.mp4 |
I implemented a workaround that reads all ffmpeg processes on my machine and checks the command to see if they match the arguments, if so, I keep the pid and then I can kill it. That's why I wanted the |
Please, provide logs as requested. |
Here I'm logging the stop call that comes from my code that calls the future
So as you can see the future was cancelled but the process is still running. My stop method public void stop() {
if (isStopping.getAndSet(true)) return;
LOGGER.info("STOP FFMPEGRunner");
isRunning.set(false);
connections.set(0);
reference.get().clear();
if (future != null) {
LOGGER.info("Future status before - {}", future.isCancelled());
future.forceStop();
LOGGER.info("Future status - {}\n\n\n\n\n", future.isCancelled());
}
onClose.run();
} |
Please, provide logs as requested |
I used a workaround to deal with it that could be added to the code, which is the https://github.com/profesorfalken/jProcesses lib to handle to close the process. It is really handy cause it deals with UNIX and Windows systems. |
Please, notice that I asked for debug logs both ffmpeg and Jaffree. |
@kokorin If FFmpeg doesn't abide by the force request of the stopper then you are effectively leaving a process alive even if the JVM shuts down. So exposing the Process instance itself would be nice. Especially if you have a highly multithreaded application that doesn't require a lot of Processing power but a lot of traffic on your Storage drives. So i highly suggest that there is a way where you can configure a bit more control over it. @HenriquePassarelli |
@HenriquePassarelli After seeing how specific the requirements are, and how little interest on meeting half way through he was, I decided to withdraw my PRs, and make my own version now that fit my needs instead of contributing to this project. Having Code style requirements is fine. Having excessive requirements and 0 leniency of meeting halfway is not fine IMO. So yeah lets see how long it will take @kokorin to get the feature in. |
Describe the issue
When I lose connection to the internet, the process sometimes doesn't close by itself, so I would like to get the
pid
for each process I run FFMpeg to close/kill/verify manually.To Reproduce
Steps to reproduce the behavior:
While running the RTSP stream, stop the connection with the internet, and you will see that the process will still run even though no one is consuming it.
Expected behavior
Close the process after losing connection or add a way to close it.
Additional context
Linux Ubuntu 20.04
The text was updated successfully, but these errors were encountered: