Commercial Detection for In-Process Recordings (Catch-up to live broadcast - especially useful for live sports/events)

Bump. It's Football season again.

Thanks to a post from @tmm1, I found out that it’s possible to manually make comskip run on in-process recordings. Here are the details on how to do it. Hopefully there will be a feature update to make this happen automatically.

Step 1: Find an existing comskip.ini file in your recordings directory ( \your_recordings_directory\Logs\comskip\1234\comskip.ini) or copy the default config below and paste it into a blank text file named comskip.ini:

verbose=10
detect_method=123 ;; everything but scenechange
punish_no_logo=0
cc_correct_type_modifier=1
length_nonstrict_modifier=1.5 ;; required before below due to comskip.ini parsing bug
combined_length_nonstrict_modifier=1
min_show_segment_length=222
min_commercialbreak=45
use_existing_logo_file=0
logo_fraction=0.39
delete_logo_file=1
output_vdr=1
output_edl=1
output_ffmeta=1
output_ffsplit=1
thread_count=1
lowres=1

Step 2: Find the location of your Channels DVR data directory. Do this by opening the Channels DVR web interface, select Support, then select Logs. Search for the text "Starting Channels DVR". You should find a line that looks similar to this that shows your data directory. "Starting Channels DVR v2022.08.08.2006 (windows-x86_64 pid:46732) in C:\ProgramData\ChannelsDVR\data". (Windows installs generally use C:\ProgramData\ChannelsDVR\data)

Step 3: Copy the default comskip.ini file to your Channels DVR data directory.

Step 4: Edit comskip.ini in the data directory.
Add the following to lines to the end of the comskip.ini file and save:

live_tv=1
live_tv_retries=4

Optional: Restart Channels DVR (according to forum feedback, this is not needed)

Step 5: Find the in-process recording on the web UI and click Redetect Commercials. Channels DVR should start detecting commercials while the recording is in-process.

3 Likes

Nice writeup.
Just a suggestion that you change your post to display the actual default comskip.ini that comes with Channels DVR.

verbose=10
detect_method=123 ;; everything but scenechange
punish_no_logo=0
cc_correct_type_modifier=1
length_nonstrict_modifier=1.5 ;; required before below due to comskip.ini parsing bug
combined_length_nonstrict_modifier=1
min_show_segment_length=222
min_commercialbreak=45
use_existing_logo_file=0
logo_fraction=0.39
delete_logo_file=1
output_vdr=1
output_edl=1
output_ffmeta=1
output_ffsplit=1
thread_count=1
lowres=1

You have added and changed items in yours, including a typo on lowres.
Also under your Step 4, there is no need to Restart Channels DVR. It looks at your comskip.ini everytime it runs commercial detection.

An easier method is to use the API to set these settings:

PUT /api/comskip/ini/live_tv/1
PUT /api/comskip/ini/live_tv_retries/4

Then, if you want to disable it:

PUT /api/comskip/ini/live_tv/0

(Edit: wrong REST verbs)

1 Like

What new behavior are you observing with these settings?

Good point. That way you can still use the UI to set number of threads.

@chDVRuser Thanks for the feedback. I corrected the default comskip.ini settings.

@racameron Thanks for providing the API calls. I agree this is a better option for more advanced users who understand how to setup everything to do this.

2 Likes

I can make these options default for in-progress recordings.

But I don't understand how this helps, because comskip still won't run automatically on those and you still don't get the results until the recording is completed.

Those options are only good when comskip is started a few minutes after the recording starts. They are useless if comskip only runs after recording is finished. Plus Comskip is more accurate when it is run after the recordings are finished.

Okay I made it so it will actually update the commercial makers in real time as the recording is being detected. You will still have to run it manually, but if this works out maybe we can make that happen automatically when you start watching.

Will be available with v2022.09.13.2222 in a few minutes

In this mode, the log will say "Running live commercial detection" instead of "Running commercial detection"

1 Like

Sounds great, Aman!

I've found with other software that the timeline (with commercials marked) changes dynamically as the recording progresses, re-marking/re-sizing the commercial blocks as comskip gets more and more information. By the time the recording is done, the marked commercial blocks are darn near as good as a regular [non-live] recording.

I love starting a football game about an hour to hour and a half late and basically catching up by the end, skipping commercials all the way. Thanks for looking into this implementation.

1 Like

I added a new setting that will kick off live comskip if you start watching a recording that is still in-progress.

7 Likes

Excellent!!!

Put that space heater on 19!

2 Likes

Ok this is awesome. But... what if i start watching something like a football game an hour after the recording started. When I catch up the 1hour mark, can the comskip live rerun?

2 Likes

It continuously runs. No need to re-run it. Comskip knows that it is a live broadcast, so it will keep scanning the recording until it ends. (That's what the live_tv = 1 setting does; it keeps scanning the recording, and once the recording ceases to change, Comskip exits.)

3 Likes

How does this work for TVE recordings using your own heuristics? Does it use Comskip for the live in-progress viewing, but replace the commercial markers with your own; or do the Comskip identified markers persist?

(@tmm1 As an aside, both the work that has been done on bringing this feature to a best-in-class UX, as well as your team's own heuristics for near flawless detection with select streaming channels, deserves great appreciation and thanks. Coupled with the work you all continually put back into the community via the myriad open projects you use and improve, makes Channels an example of for-profit companies actively working to do good through open-source. Thank you.)

4 Likes

I believe I have the same question as @racameron. I was wondering how this effects what has been called Smart Detection. Also, I will surely need to reread through this thread, but is there an idea on how this will effect the processor usage on the server. Also, is Comskip run (again) after the conclusion of processing.

2 Likes

It will most likely be the same as when the Comskip process normally runs ... after all, it's the same program.

However, this brings up another question: how does this affect the commercial detection of other regularly recorded programs? Does this fall into the queue? Are completed recordings that end during a live detection run when the recording ends, or are they placed into the queue to run after the in-progress run ends?

(All of these questions and whatabouts make it clear why this feature is not so prevalent ...)

Detecting commercials while recording Jeopardy! S39E02 2022-09-13-1859.mpg.
Watching Jeopardy! - Season 39, Episode 2 from Edwin's Fire TV at 12s
1 Like