Tuesday, April 26, 2016

Automatically Skip Commercials

How to Automatically Skip Commercials in NextPVR with Comskip


comskip-running

So you’ve set up live TV on your computer with NextPVR, and maybe even set it up to stream to every computer in your house. The only downside? Those pesky commercials in your recorded shows. Here’s how to get rid of them automatically.

Comskip is a free Windows program capable of detecting commercials in recorded TV shows. It will find and skip ads without you having to lift a finger, whether you’re watching in VLC or through a media center program like Kodi. That way, you can just lean back and enjoy your show without interruption. All it takes is a bit of setup.

Step One: Download and Try Out Comskip


To get started, head to the Comskip download page and grab the most recent version of the software. It will be a .zip file called “comskip”, followed by the version number. Find the highest version number, or the most recent date. As of this writing it’s, version 81_092 from March 7, 2016.

download-comskip

Open the ZIP file and drag its contents to any folder you’d like. I recommend C:\comskip , and will be using that in the rest of the tutorial, but you can put it wherever you want.

comskip-folder

There are a bunch of files here, but to get started with Comskip, we’re going to use “ComskipGUI.exe” to indentify some commercials. In a separate Windows Explorer window, browse to your PVR’s collection of recorded episodes, and pick a video you’d like to watch without commercials. Drag the video file to the icon for ComskipGUI.exe, and you’ll get a first hand view of how Comskip works.

comskip-running

You’ll see the video itself in real time, and colors graphs that show Comskip’s attempts to identify commercials. It will sometimes loop back to re-check things, and the process can take a while, but it’s fascinating to watch. You’ll see the tool identify the network logo displayed during broadcasts, notice black frames, and try to identify things like spikes in volume.

When the process is done, Comskip will output a simple text file.

comskip-txt-file

This is the time, in seconds, when Comskip thinks commercial breaks start and end in the video you just tried out. Neat, right? We’re just getting started.

Step Two: Configure Comskip To Create EDL Files In Real Time


NextPVR can’t use that text file to skip commercials, however–it needs an “EDL” file. Happily, Comskip is capable of making those, it just needs to be told to do so. There are two ways to do this. The first is to open comskip.ini , located in your Comskip folder, with a text editor (Notepad is fine). then ensure the following lines include a “1” instead of a “0”:

output_edl=1

live_tv=1

Here’s what that looks like in the text document:

comskip-text-editor

The first, output_edl=1 , tells Comskip to create an “EDL” file. It should be enabled by default in recent versions of Comskip, but it’s worth checking just in case. The second configuration, live_tv=1 , tells Comskip to create this EDL file in real time, which is useful for skipping ads while pausing live TV.

If you’d rather not edit the text file, you can instead open the “ComskipINIEditor” program and use the GUI configuration tool. You’ll find the “output_edl” option under “Output Control”:

comskip-edl-enabled

And the “live_tv” option under “Live TV”:

comskip-live-tv-enabled

It doesn’t matter if you configure the file using the GUI or using a text editor, so use whichever method you prefer.

Step Three: Configure NextPVR To Run Comskip While Recording


Next up, you need to tell NextPVR to run Comskip. First, we need to find the NextPVR configuration folder. By default, this is in C:\Users\Public\NPVR\ , but it could be different if you took some custom steps while installing NextPVR. When you find the folder, open the “Scripts” subfolder within it.

Right-click in the window, hover over “New”, then click “Text Document”.

comskip-create-file

Name the file ParallelProcessing.bat , making sure to replace the .txt extension fully.

scripts-folder-comskip-nextpvr

Right-click the file to open it with a text editor (Notepad is fine). Then, paste the following three lines into the file:

@echo off
cd /d "C:\comskip"
comskip %1

processing-bat-file

This will tell NextPVR to run Comskip as you’re recording shows. If you’d rather have Comskip run after a recording is complete, instead of during, simply rename the file to PostProcessing.bat .

Either way, Comskip will now run automatically every time a show is recorded. You can verify this is happening by browsing to your recordings’ folder: you’ll find the TXT and ELD files for your recording there. Play that recording from NextPVR, and you’ll see that the ads don’t appear.

Step Four: Configure Kodi To Skip Ads


Chances are, you aren’t watching shows in the NextPVR app itself–you’re watching them through an all-in-one media center program like Kodi. Unfortunately, the official NextPVR addon for Kodi streams the content from NextPVR, and support for Comskip is not enabled. It is unlikely this is going to change anytime soon, which is unfortunate, but there are workarounds. You have two main options:


  • Browse to the actual files in Kodi, instead of watching them via the “Recordings” library
  • Use the X-NEWA add-on to watch recordings instead of the default NextPVR add-on for Kodi.

The first method is less elegant, but much easier. You need to add your recorded videos to Kodi as a video source, then browse to it when you want to watch something. Under “Videos”, select “Files”.

kodi-videos-files

From here, select “Add Videos”. You’ll be shown this window:

kodi-videos-browse

Select “Browse”, then find your folder of recorded shows. Exclude the folder from scans in the next step. The source is now added to your “Files” section, and you can watch your videos from here commercial-free.

browsing-files-kodi

This is a more combersome option, because it means adjusting to a new user interface that doesn’t play nicely with all Kodi skins. (Some skins may let you add this folder as a “Favorite”, though, making it easier to access.) It also means you won’t have episode summaries, which is a bummer.

If that bothers you (and it really bothered me), I recommend you look into X-NEWA instead. This is an alternative Kodi plugin for NextPVR, and it supports Comskip. It’s very complex, though, so we won’t be discussing it in this particular guide.

Step Infinity: Fine-Tune Your Comskip Settings For Accuracy


Comskip isn’t perfect. Identifying what’s an ad and what’s part of your show can be tricky, and sometimes Comskip makes mistakes. If you notice the same ones happening again and again, you can edit the “comskip.ini” file to better identify things.

Personally, I’ve had great luck with the default settings. I haven’t seen a commercial in months, except for a few station promos. But TV varies from country to country, and different TV providers work differently as well. Guessing and testing might be necessary to make things perfect for you, so play around with “ComskipINIEditor.exe” if you’re not getting the results you want.

Alternatively, there are a few country and provider specific comskip.ini files to try out on the official forum. A few US-specific ones are offered, along with Canada and Australia. They may help point your experimentation in the right direction.

By How to Geek

No comments:

Post a Comment