Comskip

  • Hi,

    We installed Comskip tools to LE9 together with my son. We finally get it working, with many trial error type of approach since there were not too many instructions available.

    Now with test file recorded from live tv we ran manually commercial detection and it seems to find those correctly (based on timestamps on vdr file) we checked from recording.

    Issue is actually in playback of video. When entering first commercial video playback jumps back on beginning of video and this is endless loop. Player which is in default on LE behaves like this.

    Anybody has similar experiences than us? Even better if someone has resolution to this. It would be nice to get this working since same approach would work nicely on realtime recording cutting commercials automatically when recording:)

    Logfile

    hastebin

  • Ok so maybe I answer to my own question what we have found so far..

    Looping seems to come from edl file format for some reason is not readable for player..

    Format is like this

    29.72 336.00 0

    943.16 1249.60 0

    1798.80 2137.60 0

    2196.20 2197.56 0

    but when changed edl as testing purposes is like this when it works

    0:00:29.18 0:05:36.00 0

    0:15:43.04 0:20:49.15 0

    0:29:58.20 0:35:37.14 0

    0:36:36.05 0:36:37.13 0

    Needs some more studying when we have time to play around.. maybe it is some ini parameter which we missed, maybe something else.

    Lets see.. but this would be great function in case of cutting out commercials from live tv if we get it working since cutting software is capable to read edl file..

    • Official Post

    This is what I use in the UK - and it seems to work for most things. I don't use post processing but rather by batch file when nothing is happening 2am (As it is quite I/O intesive.)

    comskip --quiet --ini=/storage/comskip.ini -t <filename>

    The -t stipulates the stream is .ts

    Change name to comskip.ini

    comskip.txt

  • Got it.

    Comskip now included to libreelec and the post processing command should be:

    /storage/.kodi/addons/service.tvheadend42/bin/comskip --ini=/storage/.kodi/userdata/addon_data/service.tvheadend42/comskip/comskip.ini %f

  • Hi,

    We got it working sorry for delay.

    Download comskip zip from tools.comskip-8.1.2.zip

    Install to libreelec via zip installation.

    Access to tvheadend configuration with web browser.

    Go to settings.

    Recoding settings.

    Insert in post prosessing box following

    comskip --ini=/storage/.kodi/userdata/addon_data/service.tvheadend42/comskip/comskip.ini %f

    Tick boxes (if you don't see selections activate expert mode in settings)

    Remove all unsafe characters from file name

    Replace white spaces..

    Use windows compatible file names

    Save and reboot..

    Then it should work

  • Hi,

    Yes we figure it out that it is part of installation when we found ini file from configuration. Reason why we go for installation via zip was that it is more faster. It took ages to complete for 45 minutes recording, after installing from zip it was few minutes. At least it what happen to our case.

    Few more notes what are useful to others.

    Logfiles sizes are increasing significantly when you record a lot, like in our case TV series. We run out of space from SD card with no time. Solution was for us to clone installation from 16 Gb to 255Gb. I suppose system cleans old Logfiles, but there are still plenty of extremely old. We need to check that as well some point of time. Recordings we store on external HDD.

    Second note which might be helpful.

    Some recordings were not passed to comskip at all. It took us long time to figure it out. For some reason when recording via rule based recording system added folder name for recording. Like e.g. Amazing Race, my son was debugging something else when that recording took place. When we checked debug log, we saw that comkip started after recording, but was trying to write in folder Race/program name.txt that failed due folder does not of course exist. Solution was to remove folder name from rule based recording and leaving it empty. As result when first recording was finished folder Amazing_Race was created and comskip files created. Comskip fails if you have whitespace or special characters either in filename or folder name, that's why you need to put those ticks in tvheadend backend filename options.

    Hopefully this is useful to someone else too., struggling these kind of issues we did as well.

    Edited once, last by JanneK: Typo coeected (July 19, 2019 at 9:33 AM).

  • I am using comskip for months now. working really fine!

    one thing woud be super amazing because new Odroid N2 has enough power to do comskip and record simultanious.

    i want to use comskip while recording. it already does work if i use comskip from another computer while recording the same video file.

    i just want to use both on one device. is this possible? as pre-recording command does not work maybe because filename is not clear on "pre-record-state"? how could we get this to work?

  • i will use it

    Yes just go for it. It is rather useful tool. skipping commercials when watching is good experience.

    For some series we cut commercials out and store permanently to HDD for later use. We use tool in windows TSdoctor for that, it is paid tool but really good. We didn't find good tool as open-source which supports teletext subtitles and EDL file support. It makes cutting more faster.

    Avidemux was pretty good but lacking those capabilites.

  • This is what I use in the UK - and it seems to work for most things. I don't use post processing but rather by batch file when nothing is happening 2am (As it is quite I/O intesive.)

    comskip --quiet --ini=/storage/comskip.ini -t <filename>

    The -t stipulates the stream is .ts

    Change name to comskip.ini

    comskip.txt

    Iridium we were looking also for that batch processing function. Due comskip in windows didn't cut perfectly.

    Is that script processing all recordings on specific folder? And folder path you put on that <filename> section?

    How do you trigger that schedule?

    Sorry for lot of questions.

    Edited once, last by JanneK (July 19, 2019 at 10:17 AM).

  • I am using comskip for months now. working really fine!

    one thing woud be super amazing because new Odroid N2 has enough power to do comskip and record simultanious.

    i want to use comskip while recording. it already does work if i use comskip from another computer while recording the same video file.

    i just want to use both on one device. is this possible? as pre-recording command does not work maybe because filename is not clear on "pre-record-state"? how could we get this to work?

    Andy I think you can use it as pre recording. I think that we tested that on rpi3 in the very beginning. Name of the file is created immediately recording is triggered. Our notice was that recording get lot of error due it sucked all the cpu / memory from rpi.

    We have no experience other boards than rpi so far so our result was on rpi3 capabilities.

    Next board for another TV set will be rpi4 which is more powerful in case of cpu/memory than rpi3. Just when they fix ps cord problem. Best thing there is usb3 ports which makes file transfer to external HDD fast.

    • Official Post

    Iridium we were looking also for that batch processing function. Due comskip in windows didn't cut perfectly.

    Is that script processing all recordings on specific folder? And folder path you put on that <filename> section?

    How do you trigger that schedule?

    Sorry for lot of questions.

    @JanneK I've moved from LE to Raspbian for TVH so I'm not totally sure of file locations.

    Your easiest solution is to put the full path of the script in TVH --> Configuration --> Recording --> Profile --> Post-processor command.

    Use "%b" to add the TVH filename as input to the script. This works fine for SD. HD files take forever to process (More than the actual program length).

    So for me: /home/pi/bin/QTVHComskip "%b"

    Batch processing does have issues unless you are sure no recording will take place whilst the script is running. I got round this by writing a script that moves the file in question once it has completed recording

    Find the comskip executable with which comskip

    This is the script I used for batch processing: Change .txt to .sh

    Qcomskip.txt

  • Hope someone can help my unique situation.

    Backend: TVH in Windows Subsystem for Linux

    Frontend is RPi3 LE

    Can my TVH (in Win) post process comskip (just mark the time stamps) and create edl or txt?

    Can my LE (in RPi3) play recordings and skip w/ edl/txt automatically?

    (AFAIK, the guide here assumes the frontend and backend are in the same machine.)