Managing and tweaking select comskip.ini settings

I'm working on an OliveTin Action to list comskip.ini settings most recently used by CDVR, along with any current overrides in place. This will also list the correct directory, based on your installation, in which to place an override compskip.ini file.

For Comskip settings that can be added via the API, an appropriate curl command will be sent. For settings that require an override INI file, the required file contents will be generated for placement in the directory shown.

This is what I've done so far:

And, the Logs-stdout that would be generated from these values:

What I'm wondering is, are there other "commonly" modified settings that anyone would like to see included in this tool?

1 Like

As far as I'm aware, all settings can be set with an API call:

PUT /comskip/ini/key/value

If a key is not present in Channels' current defaults, one will be added and used; values can be changed/overridden by supplying a new value for an existing key.

That's awesome if true, and one of the reasons I'm creating this Action. Searching the forum can sometimes lead to outdated information being used. There are numerous posts that describe the process as I've set it up. Easy work to switch things up though if it can all be done through the API now.

I'm not sure if it works, but I believe you can also DELETE /comskip/ini/key to fully remove a key and use the supplied internal default.

See this topic if you haven't already

Thanks. I've seen that post, and I believe most of the others on the topic. I think I have a handle on how this works -- but please let me know if I'm off-base on any of my conclusions.

Unfortunately, this does not appear to be true. Although settings PUT via the API do end up in the comskip.ini file, previous posts have stated that in cases of setting duplication, only the first in honored. I just tested this, and it appears my PUT of min_commercialbreak does not overrride the default:


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
min_commercialbreak=25
thread_count=1

Not sure about this

I'll see if I can figure out a reasonable test for this.

What you probably want to do is to first let the user know what settings are currently being used.

If there's an override comskip.ini file in place, only those settings are used.

If no override comskip.ini file, then the default comskip.ini settings, plus any API overrides are being used.

The caveat being an API override setting can be in place, but will not override any values present in the default comskip.ini. Although it will be appended to the default comskip.ini, only the first instance of a setting is used by comskip.

Verified

Correct

Unless @tmm1 changes the behavior of the comskip API to prepend instead of append settings to the default comskip.ini, the best way to get what you want is just use an override comskip.ini file.

Are you certain about that?

robert@bragi:~$ curl -sXGET http://10.0.10.71:8089/comskip | jq '.ini'
{
  "thread_count": "1"
}
robert@bragi:~$ curl -sXPUT http://10.0.10.71:8089/comskip/ini/output_vdr/0
true
robert@bragi:~$ curl -sXGET http://10.0.10.71:8089/comskip | jq '.ini'
{
  "output_vdr": "0",
  "thread_count": "1"
}
robert@bragi:~$ curl -sXPUT http://10.0.10.71:8089/comskip/ini/output_vdr/1
true
robert@bragi:~$ curl -sXGET http://10.0.10.71:8089/comskip | jq '.ini'
{
  "output_vdr": "1",
  "thread_count": "1"
}
robert@bragi:~$ curl -sXDELETE http://10.0.10.71:8089/comskip/ini/output_vdr
true
robert@bragi:~$ curl -sXGET http://10.0.10.71:8089/comskip | jq '.ini'
{
  "thread_count": "1"
}

Or are you referring you combining both using a separate custom comskip.ini in addition to setting Comskip settings via API? I think an either/or approach would work, but combining them can obviously lead to confusion.

Setting you add using the API are appended to the default comskip.ini (when comskip runs)

If you have an override comskip.ini file in place, only that will be used and the API settings will not.

I agree the PUT in honored, but it does not replace the default value in the Logs/comskip/fileID/comskip.ini file that is used for Comskip processing of that recording, but rather is added to that file.

root@ee51750f5570:/# curl http://$CHANNELS_DVR/comskip
{"available":true,"customized":false,"enabled":true,"ini":{"min_commercialbreak":"25"},"queued":0}

The resulting INI generated by CDVR, with no override file in place, is:


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
min_commercialbreak=25
thread_count=1

I suppose one workaround would be to create a custom comskip.ini, but just as an empty file ... and then use the API to manually set each of those settings that Channels uses as a default. Offer the user a "Would you like to manage Comskip settings via this app?", and then all Comskip settings are set via your app.

Maybe someone could port the comskip.ini GUI editor
It uses the comments in the comskip.txt file for help on the settings

Then use the comskip.ini as an override comskip.ini file in Channels DVR.

I do like that utility, and remember using it way-back-when. Do you know if it's open source? I don't think I've seen the code anywhere.

Don't know.
9 years ago it was added to the comskip distro and here's the user that created it.
https://www.kaashoek.com/comskip/viewtopic.php?f=2&t=1601

ok confirmed:

$ cat test.ini
min_commercialbreak=21
min_commercialbreak=22

$ ./comskip --ini=test.ini --verbose=10 /dev/null 2>&1 | grep min_comm
min_commercialbreak=21

We could change behavior in the DVR to put custom entries in a better location