vmaf-gui
vmaf-gui copied to clipboard
Closing the application doesn't end the process and a few other bugs
Hello,
Straight to the point:
- Once the VMAF score has been presented and the log.xml opened and shown to the user, exiting VMAF-GUI by pressing the 'x' doesn't end the process. The exe is still running.
- Exiting midway through a comparison closes the application, but leaves the ffmpeg process running and continuing the decompress the file(s).
Once the VMAF score has been presented and the log.xml opened and shown to the user, exiting VMAF-GUI by pressing the 'x' doesn't end the process. The exe is still running.
Could you clarify? Does the form close but the process still shows as running in task manager?
Exiting midway through a comparison closes the application, but leaves the ffmpeg process running and continuing the decompress the file(s).
I'll need to add a handler for when the form is closed so I can kill the currently running job, good catch
Could you clarify? Does the form close but the process still shows as running in task manager?
Yes, the form/window closes but the process is not terminated.
I'll need to add a handler for when the form is closed so I can kill the currently running job, good catch
Excellent and thank you. This piece of software is like a rare gem. It does exactly what you state it's meant to, and it performs the task well, with only a few minor issues.
Yes, the form/window closes but the process is not terminated.
I cloned the repo to my machine and tested and I experienced the same. This is likely due to the fact that ffmpeg or vmaf was launched by vmaf-gui and is considered by the OS to be part of vmaf-gui
Here's a couple of events recorded by Windows. There's not much of use here, but some of the information should be useful.
Application: vmaf-gui.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException at System.Windows.Forms.Control.MarshaledInvoke(System.Windows.Forms.Control, System.Delegate, System.Object[], Boolean) at System.Windows.Forms.Control.Invoke(System.Delegate, System.Object[]) at System.Windows.Forms.Control.Invoke(System.Delegate) at vmaf_gui.Form1+<>c__DisplayClass7_0.<button1_Click>b__0() at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()
Application: vmaf-gui.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ComponentModel.Win32Exception at System.Diagnostics.Process.StartWithCreateProcess(System.Diagnostics.ProcessStartInfo) at System.Diagnostics.Process.Start() at vmaf_gui.Form1.ChildProcess(System.String, System.String, Boolean) at vmaf_gui.Form1.vmaf(System.String, System.String, Boolean, Boolean) at vmaf_gui.Form1+<>c__DisplayClass7_0.<button1_Click>b__0() at System.Threading.ThreadHelper.ThreadStart_Context(System.Object) at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean) at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) at System.Threading.ThreadHelper.ThreadStart()
I assume the unhandled exception is caused by manually killing ffmpeg from task manager? Or is it caused by closing the form?
I've attempted to resolve this by aborting the Thread that handles each child process and I've tried to kill the currently running child process on the form close event. I'm not super experienced with C#. Fixing this issue seems to be beyond me at this point. I'm very much leaning at this point towards archiving this repo after redoing it in electron
Modifying this method to return the process handler should enable us to use the Kill
method on form close
https://github.com/ThatNerdUKnow/vmaf-gui/blob/master/vmaf-gui/Form1.cs#L18
Actually, it might be better to create a vector of process handlers as a member of the Form1 class and call the Kill
method on each handler on form close. When the ChildProcess
function is called we can simply push the process handler into the member