Managing and tweaking select comskip.ini settings

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

The need for an override comskip.ini to tweak most, if not all, settings could be eliminated this way -- which would be great. :partying_face:

Very strange decision by the comskip developer to not use the last duplicate entry in a file. I think that's one of the only programs I've seen that acts on config that way.