Comskip is used for detecting and skipping ads and as far as I can tell, the current comskip configuration produces a number of files. The 3 files of interest are: Recording.edl, Recording.txt and Recording.vdr.
When Kodi loads a recording to be played, it requests the 'cutpoints' from TVHeadend.
TVHeadend will first try to read the cutpoints from Recording.txt. If it is successful, it will stop there. If no Recording.txt file is found, TVH will then try to read the cutpoints from Recording.edl. Recording.vdr is never referenced.
I have been doing some work on TVH that will write 'scene marker' records into an 'edl' file for the start and then end of the EPG event. If, for example, there are 2 minutes of pre-padding a 30 minute programme and then 5 minutes of post-padding, scene markers will be inserted at 2 minutes and 32 minutes. These scene markers are written immediately after the recording has finished.
Unfortunately, when comskip runs, it overwrites the scene marker edl records that were just created.
I would like IceTV to consider making a few changes so that these two features can coexist.
comskip.ini
In addition to this, I have written small proof-of-concept script that demonstrates the principle of saving the TVH scene markers before comskip runs and then reapplying them once comskip has created its edl file.
With a combination of these two features, the user will be able to jump to near the beginning of the programme and then also skip the ads during playback. Here is what the final result looks like, with annotations.

Thoughts and comments welcome.
When Kodi loads a recording to be played, it requests the 'cutpoints' from TVHeadend.
TVHeadend will first try to read the cutpoints from Recording.txt. If it is successful, it will stop there. If no Recording.txt file is found, TVH will then try to read the cutpoints from Recording.edl. Recording.vdr is never referenced.
I have been doing some work on TVH that will write 'scene marker' records into an 'edl' file for the start and then end of the EPG event. If, for example, there are 2 minutes of pre-padding a 30 minute programme and then 5 minutes of post-padding, scene markers will be inserted at 2 minutes and 32 minutes. These scene markers are written immediately after the recording has finished.
Unfortunately, when comskip runs, it overwrites the scene marker edl records that were just created.
I would like IceTV to consider making a few changes so that these two features can coexist.
comskip.ini
Code Select
output_default=0 ; Turn off the default comskip 'txt' output.
edl_skip_field=3 ; Use the ad break marker type (3) instead of the cut marker type (0).
output_vdr=0 ; Turn off the unneeded 'vdr' output.
In addition to this, I have written small proof-of-concept script that demonstrates the principle of saving the TVH scene markers before comskip runs and then reapplying them once comskip has created its edl file.
Code Select
#!/bin/bash
#Get the file name only
BASEONLY=`basename "$1" mkv`
#Get the directory name only
DIRONLY=`dirname "$1"`
#Create the EDL file name
FULLNAME="$DIRONLY/$BASEONLY"edl
#If the EDL file exists, save the scene marker records (type = 2)
if test -f $FULLNAME; then
cat $FULLNAME | awk '$3 == 2 {print $0}' > "$FULLNAME"_saved
fi
#Run comskip
/usr/share/kodi/addons/service.tvheadendicetv/bin/comskip --ini=dmc_comskip.ini sample.mkv
#If a saved EDL file exists, add that to the end of the new EDL
if test -f "$FULLNAME"_saved; then
cat "$FULLNAME"_saved >> $FULLNAME
rm "$FULLNAME"_saved
fi
With a combination of these two features, the user will be able to jump to near the beginning of the programme and then also skip the ads during playback. Here is what the final result looks like, with annotations.
Thoughts and comments welcome.