I've put something together that works as a 'hook' to run scripts when a recording completes. See https://github.com/Channels-DVR-Goodies/cuckoo. It's currently in a 'works for me' status, I'd love for other people to give it a try, and give me feedback.
In a nutshell, it replaces the Channels DVR's private copy of comskip
with an executable that runs whatever it finds in a directory (in alpha-sort order). It makes a copy of the private copy of comskip with the name '50-comskip
' so you can run scripts or other executables before or after the private copy of comskip
is executed.
It's been working great for me for a couple of months now. It only supports Linux, needs to be re-applied when Channels DVR updates itself (though that's painless, could even be done with a cron job) and the documentation could be improved...
This is a stop-gap until the intrepid crew at FancyBits can put an 'official' mechanism in place. It's not an ideal solution, but it is 'clean' in that it does not modify Channels DVR or the private copy of comskip
. It just subverts the invocation of comskip
by Channels DVR to run something else (using standard Linux mechanisms), which in turn also invokes the private copy of comskip
as well as other scripts/executables of your choosing. It also passes through the parameters that Channels DVR passes to comskip
, so you get the path to the recording, etc.
Obviously you need to have the 'Detect Commercials
' option enabled, or comskip
won't be called by Channels DVR in the first place.
While you're at it, turn on 'MCEBuddy Metadata' and 'EDL Export', and take a look at https://github.com/Channels-DVR-Goodies/json2shell and https://github.com/Channels-DVR-Goodies/edl2mkvchapters
https://github.com/Channels-DVR-Goodies/json2shell takes the JSON file that MCEBuddy Metadata outputs, and turns the contents into shell variables. Thus your scripts can have access to all the metadata that the JSON file contains. I use it to organize my transcoded recordings by genre, for example.
https://github.com/Channels-DVR-Goodies/edl2mkvchapters takes the EDL file and converts it to a 'chapters' file for use with mkvmerge
. Thus you can add chapter marks for the regions identified by comskip. Personally, I prefer chapter marks over actually cutting the file, because comskip
isn't 100% trustworthy for me. Chapter marks are non-destructive. This 'chapters' file is of the ' XML based chapter format' type , so it's more sophisticated than the one that you can ask comskip to generate, which is the 'simple format'.