Logo based comskip

Here you can ask your questions on how to use Comskip for the detection of commercials. Also questions on how to remove commercials are welcome
Post Reply
markn62
Posts: 16
Joined: Sun Jun 30, 2019 8:17 pm

Logo based comskip

Post by markn62 »

Background; I'm using method 67 to detect a few shows on the same channel having the same show logo, resolution, aspect ratio. However, about 1 in 5 show recordings don't detect enough of the logo to delete commercials. When I copy a logo.txt file i.e. titleA_date.logo.txt after a successful comskip.exe culling to another video filename that had a bad culling i.e. titleB_.logo.txt and reprocess titleB, then I get good commercial cuts in titleB because it didn't have to scan for a new logo in titleB and fail proper detection. I have tried many of the logo tunings and can't seem to get accurate logo detection in some cases even though the quality and appearance looks the same between shows.

Question#1; Can I reference a static logo.txt file in an ini so every show using this ini attempts to use the static logo file for more reliable detection? My only work-around right now is to create a script to copy and rename the logo.txt to match other ts filenames before commercial cutting is performed.

Question#2; Most of the time cuts are spot on. Occasionally cuts are made 30 to 60 second after the logo disappears and less often in the same time range after the logo re-appears. I presume this is because comskip looks for a black scene after the logo to make the actual cut point. Is there a way to make the logo appear/disappear point the actual cut point, not the associated black scene? These occasional bad cuts have a 30 or 60 second commercial then jumps the rest of the commercial block to the start of the next show block. Or occasionally after the commercial block it cuts some of the show block until there is a black scene within it.
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: Logo based comskip

Post by erik »

There is a command parameter to tell Comskip what logo file to use
Increase the shrink logo parameter in the ini file to prevent missing the final black frame
markn62
Posts: 16
Joined: Sun Jun 30, 2019 8:17 pm

Re: Logo based comskip

Post by markn62 »

Says; use_existing_logo_file=1 ; Use logo file already created at beginning of show, default 0
I want to use a logo file already created by a "different" show. The one already created by the "same" show is no good. I'll try shrinking the logo to see if it helps issue #2 & report back.
markn62
Posts: 16
Joined: Sun Jun 30, 2019 8:17 pm

Re: Logo based comskip

Post by markn62 »

shrink_logo is already default 5. So I don't see how increasing it will help create a cut point at the disappearance of a logo because there is no black scene just before the logo disappearance, at least not within 5 to 0 seconds of the disappearance. Why isn't there an ini setting the enable a cut point "at" the appear/disappear of a logo not reliant on an associated black frame? Kind of makes the logo detection method less effective. In my case the logo isn't appearing before the show.
markn62
Posts: 16
Joined: Sun Jun 30, 2019 8:17 pm

Re: Logo based comskip

Post by markn62 »

I didn't think anyone could answer this. Why? Because Comskip CAN'T remove commercials on "only logos" even when set to detect_method=2. It only creates a cutpoint and needs, at a minimum, a black frame before it will designate a start/end cutpoint as a commercial block. Quite a shortcoming and a misleading detect_method.
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: Logo based comskip

Post by erik »

It is possible to generate cutpoints at logo (dis) appearing either at a near silence or unconditional
Please read comskip.txt
markn62
Posts: 16
Joined: Sun Jun 30, 2019 8:17 pm

Re: Logo based comskip

Post by markn62 »

I might read it if you told me where it is. Searching this site, only your post comes up with that filename. Didn't come in the download of comskip either. I'm not buying your claim it can be made unconditional or you would have provided an example .ini or other documentation. Neither has anyone else on this forum after days of searching. Using detect_method=2 should automatically be unconditional.
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: Logo based comskip

Post by erik »

Inside the comskip distribution zip file
markn62
Posts: 16
Joined: Sun Jun 30, 2019 8:17 pm

Re: Logo based comskip

Post by markn62 »

Of course I've read that file. What in it was I supposed to glean that would tell me how to make a "logo only" comm cut work? According to the file I should be able to use the comskip.ini that came with the install zip and change to detect_method=2. However that doesn't work. Always leaves at least one to two commercial after the logo disappears. This behavior tells me its looking for something else "in addition" to the logo. I'm also told to look at the country ini examples. No where in that list of files is there one for "logo only". Only specific providers and countries.
markn62
Posts: 16
Joined: Sun Jun 30, 2019 8:17 pm

Re: Logo based comskip

Post by markn62 »

This is the closest I've got, a 1 hr shrinks to a range from 41 to 50 minutes. The lower meaning almost none or no commercials.

Code: Select all

detect_method=67 
validate_silence=1 
validate_uniform=1 
validate_scenechange=1 
verbose=0 
max_brightness=60 
test_brightness=40 
max_avg_brightness=25 
max_commercialbreak=600 
min_commercialbreak=25 
max_commercial_size=125 
min_commercial_size=4 
min_show_segment_length=170 
non_uniformity=500 
max_volume=500 
min_silence=2 
logo_at_bottom=1 
punish=0 
punish_threshold=1.3 
punish_modifier=2 
intelligent_brightness=0 
logo_percentile=0.92 
logo_threshold=0.75
punish_no_logo=1 
aggressive_logo_rejection=0
connect_blocks_with_logo=1 
logo_filter=0 
cut_on_ar_change=1 
delete_show_after_last_commercial=0 
delete_show_before_or_after_current=0 
delete_block_after_commercial=0 
remove_before=0 
remove_after=0 
shrink_logo=0 
after_logo=0 
padding=0
ms_audio_delay=5
volume_slip=20
skip_b_frames=0 
max_repair_size=200 
disable_heuristics=4
delete_logo_file=0 
output_framearray=0 
output_data=0 
output_videoredo=0 
output_videoredo3=0 
output_womble=0
output_mls=0 
output_cuttermaran=0
output_mpeg2schnitt=0
output_mpgtx=0
output_dvrcut=0
output_zoomplayer_chapter=0
output_zoomplayer_cutlist=0
output_edl=1
output_dvrmstb=0 
output_edlx=0
output_vcf=0
output_bsplayer=0
output_btv=0 
output_projectx=0 
output_avisynth=0
output_vdr=0 
output_demux=0 
sage_framenumber_bug=0
sage_minute_bug=0
live_tv=0 
live_tv_retries=4 
dvrms_live_tv_retries=300 
standoff=0 
"cuttermaran_options=""cut=\""true\"" unattended=\""true\"" muxResult=\""false\"" snapToCutPoints=\""true\"" closeApp=\""true\"""""
"mpeg2schnitt_options=""mpeg2schnitt.exe /S /E /R25  /Z %2 %1"""
"avisynth_options=""LoadPlugin(\""MPEG2Dec3.dll\"") \nMPEG2Source(\""%s\"")\n"""
"dvrcut_options=""dvrcut \""%s.dvr-ms\"" \""%s_clean.dvr-ms\"" """
"windowtitle=""Comskip - %s"""
border=10
before_logo=0
delay_logo_search=65
ignore_right_side=800
two_pass_logo=1
maxbright=1
brightness_jump=200
global_threshold=1.05
cut_on_ac_change=1
noise_level=5
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: Logo based comskip

Post by erik »

If you feel the need for further improvement you can always follow the "how to ask for help" post and I will gladly try to further improve your tuning.
Do make sure you include data from at least two recordings
zozolapino
Posts: 2
Joined: Wed Jan 01, 2020 12:20 pm

Re: Logo based comskip

Post by zozolapino »

Hi!

Same problem here (with AB3 Belgium), there is no black frame before/after commercials, so not cutpoint with logo detections (method 2). Logo detection is all right.
Re: Logo based comskip
Post by erik » Wed Jul 24, 2019 9:23 pm

It is possible to generate cutpoints at logo (dis) appearing either at a near silence or unconditional
Please read comskip.txt
I read all the last file, but I don't see this "uncondionnal logo cutpoint" parameter.

Thanks for your help!
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: Logo based comskip

Post by erik »

Please follow the "how to ask for help" post and I will gladly support you tuning.
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: Logo based comskip

Post by erik »

I don't see this "uncondionnal logo cutpoint" parameter.
Mmmm. Indeed missing in documentation.
Set
before_logo=999
or
after_logo=999
to create unconditional cutpoints when logo (dis)appears
zozolapino
Posts: 2
Joined: Wed Jan 01, 2020 12:20 pm

Re: Logo based comskip

Post by zozolapino »

Thanks Erik!

It works but I had to change this:
if (i > 0 && F2L(logo_block.start, logo_block[i-1].end) < max_commercialbreak/4)
continue;
if (i == 0 && F2T(logo_block.start) < max_commercialbreak/4)
continue;


to this
if (before_logo!=999) // added
{
if (i > 0 && F2L(logo_block.start, logo_block[i-1].end) < max_commercialbreak/4)
continue;
if (i == 0 && F2T(logo_block.start) < max_commercialbreak/4)
continue;
}


to get it work in comskip.c (lines ~4134) and same for after_logo. Otherwise "if (before_logo==999)..." is never reached.
Post Reply