2006-12-30, 12:58 AM
zehd Wrote:I have the same trouble with ZProcess which spawns ffmpeg.exe trying to transcode on the fly for viewing files on the MVP...That's pretty much what I had in mind until Brian suggested using a Windows service. The Windows service approach seems like it will provide an "industrial strength" solution. Hopefully I can make it generic enough that it could be used for ffmpeg, mencoder (or any long running process that needs to be automatically killed if its parent dies) as well as for vlc.
What I did was:
ZProcess is called by GB-PVR.
It spawns ffmpeg.exe
It also spawns a watcher program (hunter.exe) that checks the PID of GB-PVR and the ffmpeg.exe window to see if they are both up and running.
If I kill GBPVR in Task Manager, Hunter sees it disappear and kills the ffmpeg.exe then exits...
If I kill ZProcess in Task Manager, Hunter sees it disappear and kills the ffmpeg.exe then exits...
If ffmpeg.exe crashes (an error or something) Hunter just exits.
If I exit the transcode process in GB-PVR, (graceful exit) GB-PVR kills ZProcess, and hunter takes care of ffmpeg.exe and itself.
It's not as classy as a real programmer might do, but it's been quite stable.
By using "stay alive" calls from the parent to keep the process running, I don't have to worry about who died or why. If nobody sent a "stay alive" message for the past 30 seconds, I kill the process unconditionally (and, optionally, delete the output file created by the process).
Not quite sure what a "real programmer" is. I think it's probably a state of mind.
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]
Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]
Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.