2020-04-23, 06:45 AM
I was looking at getting this working on my machine and the wiki is sparse when it comes to Linux examples, and searching the forums left me with breadcrumbs that got me to success, but I thought I'd chronicle my experience here for anyone else who'd love this wonderful addon to npvr.
I'm running on bare metal Ubuntu 18.04.
Building Comskip is really quick and easy on Ubuntu, so probably the same for any Debian based distro:
Note: I might be missing some dependencies. Sorry. I compiled several days before writing this post, and my system has been doing media stuff for years, it's very likely I already had necessary dependencies installed.
Next you need a comskip.ini . It doesn't really matter where you put this file as you specifically call out its location when you use it later. It just needs to be accessible by the user running the nextpvr service. Mine is /etc/comskip.ini:
Note: the "verbose=10" line will result in a lot going to your log file, if you use a log file. If you redirect to /dev/null, the verbosity setting doesn't matter.
Next you need ParallelProcessing.sh. This file needs to live in /var/opt/nextpvr/scripts. A very basic one is this:
A slightly more useful one that keeps a log of the comskip attempt and uses 'nice' to not peg your CPU is this:
Remember that this script is called by the user who is running the nextpvr service, and you probably don't know for sure what the PATH variable is. Make it easy on yourself and provide the full paths to the executables. You can find them by running "which nice" and "which comskip".
This file needs to be executable by the nextpvr user. Being executable by all is fine afaic:
And there you go. Restarting the nextpvr service is not necessary to bring these changes into service.
A note on usage: sub/mvallevand can correct me if I'm wrong here, but I believe ParallelProcessing.sh is only called when you specifically record a show. That means that if you tune in to a live TV channel it does not start processing the stream for commercials until you hit the 'record' button.
I'm running on bare metal Ubuntu 18.04.
Building Comskip is really quick and easy on Ubuntu, so probably the same for any Debian based distro:
Code:
$ sudo apt-get update
$ sudo apt-get install ffmpeg libavcodec-dev libavformat-dev libavutil-dev autoconf automake git libargtable2-dev libtool
$ git clone git://github.com/erikkaashoek/Comskip
$ cd Comskip
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install
Note: I might be missing some dependencies. Sorry. I compiled several days before writing this post, and my system has been doing media stuff for years, it's very likely I already had necessary dependencies installed.
Next you need a comskip.ini . It doesn't really matter where you put this file as you specifically call out its location when you use it later. It just needs to be accessible by the user running the nextpvr service. Mine is /etc/comskip.ini:
Code:
output_edl=1
live_tv=1
edl_skip_field=3
max_commercialbreak=300
verbose=10
Note: the "verbose=10" line will result in a lot going to your log file, if you use a log file. If you redirect to /dev/null, the verbosity setting doesn't matter.
Next you need ParallelProcessing.sh. This file needs to live in /var/opt/nextpvr/scripts. A very basic one is this:
Code:
#!/bin/bash
/usr/local/bin/comskip --ini=/etc/comskip.ini "$1" > /dev/null
A slightly more useful one that keeps a log of the comskip attempt and uses 'nice' to not peg your CPU is this:
Code:
#!/bin/bash
/usr/bin/nice -n 19 /usr/local/bin/comskip --ini=/etc/comskip.ini "$1" > /var/opt/nextpvr/logs/"comskip-${5}.log"
Remember that this script is called by the user who is running the nextpvr service, and you probably don't know for sure what the PATH variable is. Make it easy on yourself and provide the full paths to the executables. You can find them by running "which nice" and "which comskip".
This file needs to be executable by the nextpvr user. Being executable by all is fine afaic:
Code:
$ chmod +x /var/opt/nextpvr/scripts/ParallelProcessing.sh
And there you go. Restarting the nextpvr service is not necessary to bring these changes into service.
A note on usage: sub/mvallevand can correct me if I'm wrong here, but I believe ParallelProcessing.sh is only called when you specifically record a show. That means that if you tune in to a live TV channel it does not start processing the stream for commercials until you hit the 'record' button.