How do I Enable/Install Comskip?

I’m running the CoreELEC 9.2.123 version of the Tvheadend 4.2.8 server on my S905W CoreELEC 9.2.5 box.

I was running a version of Tvheadend 4.3 server on my Shield TV box. Enabling Comskip was pretty easy, I just put the command " libcomskip.so “%f” " in the Recording Post-processor command field.

I tried that on the CoreELEC version of the Tvheadend server but it didn’t work. I noticed there is a comskip.ini file put in a comskip folder in the service.tvheadend42 folder during installation. That suggests there is a way to enable comskip in the CoreELEC version of the Tvheadend server.

Could someone provide instructions (or point me to where I can find them) on how to enable or install comskip in CoreELEC?

Thanks

just use comskip command

OK, I’ll give it a try.
Thanks

I put comskip “%f” in the post-processing field and it worked. However, the Tvheadend log file has an error that it can’t find the comskip.ini file.
Where should I put the comskip.ini file so Tvheadend/comskip can find it?
Thanks

You didnt read what comskip command tell you didnt you :slight_smile:

–ini= Ini file to use

Ok, so I put comskip --ini=/storage/.kodi/userdata/addon_data/service.tvheadend42/comskip/comskip.ini “%f” into the Post-processing field.
That resulted in the command being interpreted as comskip --ini=/storage/.kodi/userdata/addon_data/service.tvheadend42/comskip/comskip.ini “/var/media/USB Drive/USBRecordings/KCRA 3 News at 5pm/KCRA 3 News at 5pm-KCRA-TV2020-11-2717-00.ts” with the spaces causing argument errors.

Here are the errors:
17:30:00.260 [ INFO] spawn: Errors:
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: excess option 3
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: unexpected argument “News”
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: unexpected argument “at”
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: unexpected argument “5pm/KCRA”
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: unexpected argument “3”
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: unexpected argument “News”
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: unexpected argument “at”
2020-11-27 17:30:00.260 [ INFO] spawn: ComSkip: unexpected argument “5pm-KCRA-TV2020-11-2717-00.ts””

What do I need to do to correct the syntax?

Thanks

I am just experimenting with this guide on my debian based TVHeadend server. It wasn’t as straightforward as the guide suggests since I had to enable the multimedia repositiory and then upgrade my system to get all the dependencies needed to build Comskip. I still had to add some dev packages after that. After that it built and a test run seems to be working OK and I have added the post processing script and added it to the post processing command in TVH.

First real life trial shows this working perfectly.

Shoog

OK, I figured out the problem. I had cut and pasted the line into the Post-processing field which caused the quotation marks around “%f” to be in a different format that comskip didn’t recognize as quotation marks. I typed in the quotation marks and that corrected the problem.

Is there a way to tell Kodi/Tvheadend to remove the comskip created .txt file when the recording is deleted from Tvheadend Recordings menu?

Bob Lightfoot
The following script called from crontab also cleans up when tvheadend deletes the comskip files when xbmc or tvheadend removes the ts file.

cleanup.sh

Be careful with this script, it just deleted all my recordings. Probably something I did in setting it up but a bit frustrating especially since the .ts files are all now zero size when I tried to recover them.

Shoog

I’m not proficient on the inner workings of CoreELEC. Any instructions on how to use the cleanup.sh file? I don’t want to wind up like Shoog.
Also, I noticed it cleans .edl files but not .txt files. I configured Comskip to output .txt files since it is the default if a .ini file isn’t used and my system seems to work good with them. Is there an advantage to .edl files?
Would I just add another section to the script to remove .txt files?
Thanks

I modified the cleanup.sh file for my system but my “do” command isn’t being recognized.

I get the following error:

CoreELEC:~ # sh /storage/scripts/cleanup.sh
/storage/scripts/cleanup.sh: line 4: syntax error: unexpected word (expecting “do”)

Am I doing something wrong?

The whole file is below:

#!/bin/bash
FILES="/var/media/USB Drive/USBRecordings//.txt"
for f in $FILES
do

take action on each file. $f store current file name

base=$(echo “$f” | sed “s/…$//”) # Remove file ext (4 char)
if [ -f $base.ts ]; then
echo “Stream File $base.ts Still exists ; nothing to cleanup”
else
echo “Stream File $base.ts Does not exist ; remove all others related”
rm $base.*
fi
done

FILES="/var/media/USB Drive/USBRecordings//.edl"
for f in $FILES
do

take action on each file. $f store current file name

base=$(echo “$f” | sed “s/…$//”) # Remove file ext (4 char)
if [ -f $base.ts ]; then
echo “Stream File $base.ts Still exists ; nothing to cleanup”
else
echo “Stream File $base.ts Does not exist ; remove all others related”
rm $base.*
fi
done

FILES="/var/media/USB Drive/USBRecordings//.csv"
for f in $FILES
do

take action on each file. $f store current file name

base=$(echo “$f” | sed “s/…$//”) # Remove file ext (4 char)
if [ -f $base.ts ]; then
echo “Stream File $base.ts Still exists ; nothing to cleanup”
else
echo “Stream File $base.ts Does not exist ; remove all others related”
rm $base.*
fi
done

FILES="/var/media/USB Drive/USBRecordings//.log"
for f in $FILES
do

take action on each file. $f store current file name

base=$(echo “$f” | sed “s/…$//”) # Remove file ext (4 char)
if [ -f $base.ts ]; then
echo “Stream File $base.ts Still exists ; nothing to cleanup”
else
echo “Stream File $base.ts Does not exist ; remove all others related”
rm $base.*
fi
done

find “/var/media/USB Drive/USBRecordings/” -type d -empty -exec rmdir {} ;

I got rid of the not recognizing the “do” problem by using the dos2unix command.
But I was still having problems with the space in “USB Drive” so I got rid of the quotes and replaced the space with \ for “USB\Drive”

But it is still having problems. I get:

rm: can’t remove ‘/var/media/USBDrive/USBRecordings/*/ * . *’: No such file or directory

Seeing that it was trying to remove * . * scared me so I stopped playing around.

Any other suggestions to remove the left over comskip files?

.” my experience should make you scared by that command since its what was responsible for shredding my recordings.

Shoog

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.