Project

General

Profile

Comskip

Added by Lisa White over 4 years ago

Does anyone have comskip up and running using ubuntu tvheadend? If so, how did you do it?

Thanks
Lisa


Replies (18)

RE: Comskip - Added by saen acro over 4 years ago

As post processing.
https://github.com/erikkaashoek/Comskip
but this can help only in some player's
https://github.com/BrettSheleski/comchap.git

So to be more effective need something as:
https://github.com/kirbs-/video-transcode
comskip + comcut + transcode = record without commercials

RE: Comskip help setup - Added by Lisa White about 4 years ago

Thanks for the information. I just got around to installing some of these programs. I installed comskip and downloaded comchap. I could not find info on installing comchap or transcode on ubuntu. What are my next steps? There is minimal information on google. How do I tie this software into tvheadend with postprocessing commands?

Thanks
Lisa

RE: Comskip - Added by Lisa White about 4 years ago

Come on guys, I know a lot of you all got this going. Can someone give me some guidance?

Thanks

RE: Comskip - Added by Brian C about 4 years ago

I recently followed this guide to setup Comskip and it's working well enough.
http://unixetc.co.uk/2020/03/16/how-to-install-comskip-on-a-raspberry-pi/

RE: Comskip - Added by Lisa White about 4 years ago

Thanks Brian. I checked this website out and did the install of comskip. I tested it like the author explained but ran into a snag. I ran the command line usr/local/bin comskip First Time Flippers.mkv and received error 'file not found". The mkv was stored in my tvheadend root. (home/hts/recordings/First Time Flippers/First Time Flippers.mkv) I copied the mkv over to usr/local/bin and ran the command line again and comskip started and completed the conversion, creating First Time Flippers.txt. I copied both files back over to the hts root recordings folder and played the file with Kodi. The MKV played but the commercials were still present. Any tips on what I am doing wrong?

Thanks
Lisa

RE: Comskip - Added by Brian C about 4 years ago

I have to ask...
Were you in the /home/hts/recordings/"First Time Flippers" folder when you ran the command?
Did you use double quotes (") around "First Time Flippers.mkv"?
Hopefully its something that simple.

If it does run successfully, it will make a file named "First Time Flippers.txt" in the same folder.

RE: Comskip - Added by Lisa White about 4 years ago

I tried it with the quotes (/usr/local/bin/comskip /home/hts/recordings/First Time Flippers/"First Time Flippers-24.mkv")
and received this:

Detection methods available:
1 - Black Frame
2 - Logo
4 - Scene Change
8 - Resolution Change
16 - Closed Captions
32 - Aspect Ratio
64 - Silence
128 - CutScenes
255 - USE ALL AVAILABLE

Errors:
ComSkip: excess option Flippers
ComSkip: unexpected argument "First Time Flippers-24.mkv"

Thoughts?

RE: Comskip - Added by Brian C about 4 years ago

You're getting closer. Try:
/usr/local/bin/comskip /home/hts/recordings/"First Time Flippers"/"First Time Flippers-24.mkv"

RE: Comskip - Added by Lisa White about 4 years ago

Thanks for the help. I did that and it processed the file. (YA!!) I downloaded an ini file as instructed by the author and installed it. I opened the postrecord.sh in text editor and changed the file paths to the following:

LOG=/usr/local/bin/scripts/logs
COMSKIP=/usr/local/bin/comskip
INI=/usr/local/bin/comskip.ini
#ADMIN=.

I executed comskip again and the ini was not recognized during the transition. I checked my paths that I created for the log and none was created. Do I have to give the ini execute permission in linux for the ini to be recognized by comskip?

Thoughts?

Thanks
Brian

RE: Comskip - Added by Brian C about 4 years ago

I had not played around with the INI since the author of that tutorial says he was happy with the default settings. I also have found similar comments elsewhere.
I did play around with it today. I wasn't sure where to put it so it would be used when executing from the command line, but I see the message says "No INI file found in current directory. Searching PATH..."
I put the INI file in the same folder as my recording and it worked. You get a message confirming it -- "Using comskip.ini for initiation values".
Now, having said that, I ran this with the command line script shown in the tutorial.
The postrecord.sh script is run after tvheadend records a program, so your edits to that file only matter when you run that script -- which is after recording a program if you follow the tutorial.

RE: Comskip - Added by Jim McDonnell about 4 years ago

Hi Lisa and Brian

I'm the author of that Comskip article (http://unixetc.co.uk/2020/03/16/how-to-install-comskip-on-a-raspberry-pi/) and just noticed this discussion. I hope it is all working for you now.

As others have stated, when a file name contains spaces (and most recording files do), it must be quoted. And that includes the whole path, like this:

"/some/directory/my file with spaces in the name"

Regarding the ini file, the simplest method is to just specify it on the command line. Then there is not doubt about it. So a full command would be like this, for example:

cd /home/osmc/Recordings
/usr/local/bin/comskip --ini /home/osmc/comskip.ini "/home/osmc/Recordings/New: Ainsley's Food We Love/New: Ainsley's Food We Love.2020-09-26.11-40.ts"

- ini specified is /home/osmc/comskip.ini
- recording file and its path is quotes.

Note that comskip creates information files in the current working directory, which allow adverts to be skipped. If you move the ".ts" recording file afterwards, and don't move the comskip (".txt") files as well, adverts won't be skipped.

Cheers,
Jim.

RE: Comskip - Added by Dave H about 4 years ago

cd /home/osmc/Recordings
/usr/local/bin/comskip --ini /home/osmc/comskip.ini "/home/osmc/Recordings/New: Ainsley's Food We Love/New: Ainsley's Food We Love.2020-09-26.11-40.ts"

To a regular linux user, this looks weird. Is there a particular reason you quoted the full path of the .ts file rather than just the filename? Also, most people will have /usr/local/bin/ in their $PATH automatically, so is there a particular reason for typing that in full as well?

If the .txt file needs to be in the same directory as the .ts file for the player to be able to use it, it seems very weird of comskip to create it in the cwd instead of in the same directory as the .ts by default, although I can see there may be circumstances where it has to create it elsewhere first.

Does comskip have any documentation?

RE: Comskip - Added by Jim McDonnell about 4 years ago

Hi Dave

I suspect you are correct and that Comskip does, in fact, create the .txt files in the same directory as the .ts file. However, Lisa is evidently a novice user of Linux, and my answer was designed with that in mind: a simple solution that leaves no room for doubt.

Regarding path quoting, it us usually done as a matter of convention, like this "/some/directory/my script.sh", and not like this /some/directory/"my script.sh". Both work, but the first is generally done to aid readability.

Comskip does not have much documentation but there is a moderate amount out there.

Jim

RE: Comskip - Added by Dave H about 4 years ago

I suspect you are correct and that Comskip does, in fact, create the .txt files in the same directory as the .ts file.

Then why say it is in the CWD, which is a completely different concept?

Regarding path quoting, it us usually done as a matter of convention, like this "/some/directory/my script.sh", and not like this /some/directory/"my script.sh". Both work, but the first is generally done to aid readability.

Sorry, I worded my question poorly. I wasn't asking about the quoting but asking why you used the full path instead of just the filename?

Comskip does not have much documentation but there is a moderate amount out there.

That's good to know. Could you point to it since I couldn't find it?

RE: Comskip - Added by Jim McDonnell about 4 years ago

Hi Dave H

Using a full or relative path for a command or file is just an alternative to chdir'ing around the file system. There are different ways to invoke Unix commands, advantageous in different situations, and none is intrinsically better than the others. There is always more than one way to do it.

Having spent the last 28 years as a professional Unix systems administrator, I am interested in sharing my knowledge through online articles and in offering help where applicable. That's why I wrote the Comskip article, and that's why I came back here to offer a little assistance/clarification. NB. I am not interested in arguing with forum users.

Regards Comskip documentation, I am not going to Google that for you. But my article contains some information and links that might be useful: http://unixetc.co.uk/2020/03/16/how-to-install-comskip-on-a-raspberry-pi/

Jim

RE: Comskip - Added by Dave H about 4 years ago

Using a full or relative path for a command or file is just an alternative to chdir'ing around the file system.

Well, no it isn't, otherwise you wouldn't have needed a chdir immediately before the comskip command in your example!

The point is, nobody uses a full path to reference a file in the current working directory on a linux system unless there is some specific reason, and if so that reason needs to be explained. So writing it with no explanation just raises hackles.

Having spent the last 28 years as a professional Unix systems administrator

Well, good for you. I spent 42 years as a professional developer, mostly on Unix and Linux, starting with the first commercial Unix system in the UK in 1979. TIMTOWTDI indeed.

Regards Comskip documentation, I am not going to Google that for you.

Ooh, you are awful :) And then you have the nerve to post a link to your article a second time! And of course, that article doesn't contain a link either - I did already look there.

And I already looked at the forum, which you do link to, and the github site, which you don't though you do provide a hint to the address. And neither of those provide a link to the documentation that I found. So I lost the will to live and decided to ask somebody who says they came 'to offer a little assistance/clarification'.

But since that person wasn't actually willing to do what they say, I was provoked into searching again and this time I did find https://www.comskip.org/ (for the benefit of anybody else reading this illuminating discussion). It seems there's some rather poor, out of date, Windows-only documentation there.

RE: Comskip - Added by Jim McDonnell about 4 years ago

Dave was a Unix/Linux developer for 42 years. And he's proved it, beyond doubt. Only a true software professional would be unable to configure Comskip, require help with basic Googling, rage into the void over pathname minutia, get seriously triggered by a blog article, and order strangers around on the Internet.

RE: Comskip - Added by Michael Michael 11 months ago

Hello all,

i installed comskip with comcut. It is working really perfectly. How can I increase the speed of comcut? I have not found a way to activate threads. The process runs with 1 CPU, but I have 32 available.

    (1-18/18)