My laptop detects commercials but my Raspberry pi doesn't

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
padillaj3
Posts: 11
Joined: Sun Dec 04, 2016 12:01 am

My laptop detects commercials but my Raspberry pi doesn't

Post by padillaj3 »

I have a Raspberry pi running Comskip on my TVHeadend recordings, the thing is that for IPTV Streams it does not detect any commercials.

If I run the same .ini file on the same video file on my laptop, then the laptop does detect commercials.

For most Recordings coming from my TV Tuner Comskip on the Raspberry pi IS able to detect commercials but not for IPTV Streams.



Here's the results for a particular recording:
Raspberry pi:
---------------------
Initial Commercial List
---------------------
No change

Logo fraction: 0.3681
Maximum volume found: 2535
Average volume: 394
Sound threshold: 500
Silence threshold: 100
Minimum volume found: 10
Average frames with silence: 29
Black threshold: 25
Minimum brightness found: 29
Minimum bright pixels found: 0
Minimum dim level found: 0
Average brightness: 545
Uniformity level: 500
Average non uniformity: 235
Maximum gap between logo's: 0
Suggested logo_threshold: 0.4250
Suggested shrink_logo: 5.00
Max commercial size found: -1
Dominant aspect ratio: 1.7800
Score threshold: 1.0500
Framerate: 59.970
Total commercial length: 0:00:00.00
Block list after weighing
----------------------------------------------------
# sbf bs be fs fe sc len scr cmb ar cut bri logo vol sil corr stdev cc
0:+ 1654 0 1654 1 55169 0.01 0.613 0.14 0 1.78 L b 5450 0.36 3940 290 0.000 54 NONE

55169 Frames Processed
Commercials were not found.

My Laptop, using the same .ini file as above gives me the following results on the same video file:
---------------------
Initial Commercial List
---------------------
0) 1 2431 0:01:21.08
1) 5101 6311 0:00:40.37
2) 13823 20186 0:03:32.61
3) 31452 36702 0:02:55.17
4) 48552 55735 0:03:59.64
Shortening commercial block 0 because the first 2 seconds should always be kept.
No change

Logo fraction: 0.3955
Maximum volume found: 10360
Average volume: 1137
Sound threshold: 500
Silence threshold: 100
Minimum volume found: 0
Average frames with silence: 69
Black threshold: 25
Minimum brightness found: 29
Minimum bright pixels found: 0
Minimum dim level found: 0
Average brightness: 414
Uniformity level: 500
Average non uniformity: 184
Maximum gap between logo's: 276
Suggested logo_threshold: 0.7750
Suggested shrink_logo: 5.00
Max commercial size found: 60
Dominant aspect ratio: 1.7800
Score threshold: 1.0600
Framerate: 29.970
Average framerate: 29.965
Total commercial length: 0:08:29.24
Cut codes:
F: scene c: change
A: aspect t: cutscene
E: exceeds l: logo
L: logo v: volume
B: bright s: scene_change
C: combined a: aspect_ratio
N: nonstrict u: uniform_frame
S: strict b: black_frame
r: resolution
----------------------------------------------------
Block list after weighing
----------------------------------------------------
# sbf bs be fs fe ts te len sc scr cmb ar cut bri logo vol sil corr stdev cc
0:00 0 0 0 1 160 0.00s 5.31s 5.31s 3.31 0.15 1 2.23 A CN a 1462+ 0.00 2318+ 97+ 0.000 146 NONE
1:-- 1 1 0 161 356 5.34s 11.85s 6.51s 1.10 0.46 1 1.78 C u 3040+ 0.00 2052+ 96+ 0.000 304 NONE
2:-- 5 1 4 357 960 11.88s 32.00s 20.12s 3.31 0.24 1 1.78 C S u 1324+ 0.00 1130- 690 0.000 132 NONE
3:-- 4 4 0 961 1627 32.03s 54.25s 22.22s 1.10 0.00 1 1.78 C a 23- 0.00 1198+ 80+ 0.000 2 NONE
4:-- 1 1 0 1628 2116 54.29s 70.57s 16.28s 4.97 0.01 3 1.32 A C a 51- 0.00 1315+ 80+ 0.000 5 NONE
5:-- 1 1 0 2117 2238 70.60s 74.64s 4.04s 4.97 0.00 3 1.50 A C a 24- 0.00 1250+ 81+ 0.000 2 NONE
6:-- 1 1 0 2239 2431 74.68s 81.08s 6.41s 2.00 0.26 0 2.14 A a 1062+ 0.00 1546+ 93+ 0.000 106 NONE
7:++ 1 1 0 2432 2504 81.12s 83.52s 2.40s 1.00 0.00 0 1.78 u 109- 0.00 2083+ 96+ 0.000 10 NONE
8:++ 8 1 7 2505 3360 83.55s 112.08s 28.53s 1.00 0.10 0 1.78 u 420+ 0.00 1155+ 74+ 0.000 42 NONE
9:++ 9 7 2 3361 5100 112.11s 170.14s 58.03s 0.01 0.07 0 1.78 L v 174- 0.39 962- 62- 0.000 17 NONE
10:-- 4 2 2 5101 6311 170.17s 210.55s 40.37s 1.50 0.04 0 1.78 N v 152- 0.21 697- 50- 0.000 15 NONE
11:++ 4 2 2 6312 8442 210.58s 281.65s 71.07s 1.00 0.07 0 1.78 v 374- 0.01 976- 59- 0.000 37 NONE
12:++ 3 2 1 8443 10567 281.69s 352.56s 70.87s 1.00 0.04 0 1.78 v 184- 0.18 791- 52- 0.000 18 NONE
13:++ 3 2 4 10568 13822 352.59s 461.17s 108.58s 0.01 0.10 0 1.78 L u 360- 0.33 1476+ 72+ 0.000 36 NONE
14:-- 5 5 0 13823 13892 461.20s 463.50s 2.30s 1.12 0.14 1 1.78 C u 1242+ 0.00 516- 46- 0.000 124 NONE
15:-- 1 1 0 13893 14653 463.54s 488.90s 25.36s 9.26 0.04 5 1.78 C S a 465+ 0.00 11370 57- 0.000 46 NONE
16:-- 1 1 0 14654 14792 488.93s 493.53s 4.60s 15.95 0.01 7 1.87 A CN v au 86- 0.00 1144+ 71+ 0.000 8 NONE
17:-- 1 1 0 14793 15692 493.57s 523.56s 30.00s 21.63 0.11 10 1.78 C S u 793+ 0.00 1447+ 91+ 0.000 79 NONE
18:-- 1 1 0 15693 16085 523.60s 536.68s 13.08s 18.90 0.19 14 1.78 C a 1376+ 0.00 1213+ 89+ 0.000 137 NONE
19:-- 1 1 0 16086 16592 536.71s 553.59s 16.88s 38.84 0.01 14 2.38 A C au 213- 0.00 1303+ 90+ 0.000 21 NONE
20:-- 1 1 0 16593 17043 553.63s 568.64s 15.02s 35.65 0.18 15 1.78 C S u 1082+ 0.00 1063- 51- 0.000 108 NONE
21:-- 1 1 0 17044 17492 568.68s 583.62s 14.95s 26.66 0.10 16 1.78 C S au 817+ 0.00 1317+ 71+ 0.000 81 NONE
22:-- 3 1 2 17493 17595 583.66s 587.06s 3.40s 11.97 0.47 16 2.38 A C u 2233+ 0.00 1186+ 86+ 0.000 223 NONE
23:-- 3 2 1 17596 17750 587.09s 592.23s 5.14s 34.95 0.23 17 2.38 A CN u 703+ 0.00 1311+ 95+ 0.000 70 NONE
24:-- 4 2 2 17751 18061 592.27s 602.61s 10.34s 69.90 0.33 17 2.38 A C S u 961+ 0.00 1507+ 97+ 0.000 96 NONE
25:-- 5 3 2 18062 18147 602.64s 605.48s 2.84s 10.36 0.37 15 2.38 A C u 1046+ 0.00 999- 77+ 0.000 104 NONE
26:-- 3 3 0 18148 18393 605.51s 613.69s 8.17s 10.36 0.50 15 2.38 A C au 1268+ 0.00 1376+ 97+ 0.000 126 NONE
27:-- 1 1 0 18394 18842 613.72s 628.67s 14.95s 19.06 0.07 13 1.78 C S u 182- 0.00 1784+ 84+ 0.000 18 NONE
28:-- 1 1 0 18843 19142 628.70s 638.68s 9.98s 24.87 0.36 12 1.78 C S u 2016+ 0.00 1320+ 95+ 0.000 201 NONE
29:-- 1 1 0 19143 19293 638.71s 643.72s 5.01s 11.23 0.24 12 1.78 CN v u 1370+ 0.00 1795+ 97+ 0.000 137 NONE
30:-- 3 1 2 19294 20093 643.75s 670.71s 26.96s 5.87 0.11 8 1.78 C v 286- 0.00 933- 51- 0.000 28 NONE
31:-- 4 2 2 20094 20186 670.75s 673.82s 3.07s 5.87 0.05 8 1.78 C v 107- 0.00 565- 40- 0.000 10 NONE
32:++ 3 2 0 20187 31451 673.85s 1049.70s 375.85s 0.00 0.04 0 1.78 EL u 149- 0.85 1052- 66- 0.000 14 NONE
33:-- 2 1 1 31452 31676 1049.73s 1057.20s 7.47s 3.80 0.32 5 1.78 C u 1346+ 0.00 1301+ 92+ 0.000 134 NONE
34:-- 1 1 0 31677 31751 1057.24s 1059.71s 2.47s 3.80 0.55 5 1.78 C au 3546+ 0.00 1307+ 85+ 0.000 354 NONE
35:-- 1 1 0 31752 32651 1059.74s 1089.74s 30.00s 24.31 0.06 6 2.64 A C S au 484+ 0.00 1188+ 74+ 0.000 48 NONE
36:-- 1 1 0 32652 33551 1089.77s 1119.77s 30.00s 22.63 0.06 8 1.78 C S u 571+ 0.00 1224+ 78+ 0.000 57 NONE
37:-- 1 1 0 33552 34451 1119.80s 1149.80s 30.00s 32.62 0.10 9 1.78 C S u 930+ 0.00 1229+ 77+ 0.000 93 NONE
38:-- 1 1 0 34452 34901 1149.83s 1164.81s 14.98s 36.02 0.23 10 1.78 C S v u 740+ 0.00 1048- 68- 0.000 74 NONE
39:-- 1 1 0 34902 35351 1164.85s 1179.83s 14.98s 35.77 0.11 10 1.78 C S u 577+ 0.00 1169+ 67- 0.000 57 NONE
40:-- 2 1 1 35352 36252 1179.86s 1209.89s 30.03s 14.91 0.08 7 1.78 C S u 923+ 0.00 1464+ 73+ 0.000 92 NONE
41:-- 2 1 1 36253 36430 1209.93s 1215.83s 5.91s 2.94 0.55 5 1.78 C u 3606+ 0.00 1429+ 95+ 0.000 360 NONE
42:-- 1 1 0 36431 36494 1215.87s 1217.97s 2.10s 2.94 0.61 5 1.78 C u 3656+ 0.00 1662+ 94+ 0.000 365 NONE
43:-- 2 1 1 36495 36702 1218.00s 1224.91s 6.91s 2.94 0.57 5 1.78 C v u 1937+ 0.00 1419+ 89+ 0.000 193 NONE
44:++ 3 1 2 36703 39669 1224.94s 1323.91s 98.97s 0.01 0.07 0 1.78 L v 259- 0.73 888- 53- 0.000 25 NONE
45:++ 3 2 3 39670 48551 1323.94s 1620.28s 296.33s 0.00 0.05 0 1.78 EL v u 172- 0.88 1034- 62- 0.000 17 NONE
46:-- 7 3 4 48552 48626 1620.31s 1622.78s 2.47s 3.54 0.00 5 1.78 C u 26- 0.00 839- 75+ 0.000 2 NONE
47:-- 8 4 4 48627 48711 1622.81s 1625.61s 2.80s 3.54 0.00 5 1.78 C v u 82- 0.00 415- 38- 0.000 8 NONE
48:-- 5 5 0 48712 49165 1625.65s 1640.76s 15.12s 14.80 0.11 6 1.78 C S u 929+ 0.00 1426+ 81+ 0.000 92 NONE
49:-- 1 1 0 49166 50065 1640.80s 1670.79s 30.00s 17.33 0.07 7 1.78 C S u 724+ 0.00 1166+ 83+ 0.000 72 NONE
50:-- 3 1 2 50066 50517 1670.83s 1685.87s 15.05s 19.98 0.08 8 1.78 C S u 681+ 0.00 1225+ 87+ 0.000 68 NONE
51:-- 2 2 0 50518 50568 1685.91s 1687.58s 1.67s 13.32 0.41 10 1.78 C a 431+ 0.00 472- 46- 0.000 43 NONE
52:-- 1 1 0 50569 51415 1687.61s 1715.84s 28.23s 26.64 0.16 10 2.38 A C au 858+ 0.00 1617+ 89+ 0.000 85 NONE
53:-- 3 1 2 51416 51860 1715.87s 1730.69s 14.82s 12.60 0.14 6 1.78 C S v 240- 0.00 1344+ 92+ 0.000 24 NONE
54:-- 2 2 0 51861 53663 1730.72s 1790.85s 60.13s 4.72 0.09 2 1.78 C S u 477+ 0.00 1259+ 80+ 0.000 47 NONE
55:-- 1 1 0 53664 55698 1790.88s 1858.75s 67.87s 1.00 0.10 0 1.78 a 489+ 0.05 1352+ 84+ 0.000 48 NONE
56:-- 1 1 0 55699 55735 1858.78s 1859.95s 1.17s 99.99 0.00 0 1.78 5 { b 135- 0.00 1347+ 61- 0.000 13 NONE

55735 Frames Processed
Commercials were found.


This is the .ini file used:
; See comskip.txt in the distribution zip file for many settable parameters, read manual.html, tuning.html and debugwindow.html for how to tune and debug comskip
edl_mode=0 ; the mode specified in the generated edl file, 0=cut, 3=commercial break
mkv_time_offset=30.0 ; offset in seconds, to work around what appears to be an xbmc or ffmpeg bug
always_keep_first_seconds=2 ; xbmc/vdpau has a bug that causes a segfault if we don't keep the start of the stream, I'll fix that when I get a chance
detect_method=255 ;1=black frame, 2=logo, 4=scene change, 8=fuzzy logic, 16=closed captions, 32=aspect ration, 64=silence, 128=cutscenes, 255=all -The detect_method should be set to the sum of these individual methods
validate_silence=1 ; Default, set to 0 to force using this clues if selected above.
validate_uniform=1 ; Default, set to 0 to force using this clues (like pure white frames) if blackframe is selected above.
validate_scenechange=1 ; Default, set to 0 to force using this clues if selected above.
verbose=10 ;show a lot of extra info, level 5 is also OK, set to 0 to disable
max_brightness=60 ;frame not black if any pixels checked are greater than this (scale 0 to 255)
test_brightness=40 ;frame not pure black if any pixels checked are greater than this, will check average brightness (scale 0 to 255)
max_avg_brightness=25 ;maximum average brightness for a dim frame to be considered black (scale 0 to 255) 0 means autosetting
max_commercialbreak=600 ;maximum length in seconds to consider a segment a commercial break
min_commercialbreak=25 ;minimum length in seconds to consider a segment a commercial break
max_commercial_size=125 ;maximum time in seconds for a single commercial or multiple commercials if no breaks in between
min_commercial_size=4 ;mimimum time in seconds for a single commercial
min_show_segment_length=250 ; any segment longer than this will be scored towards show.
non_uniformity=500 ; Set to 0 to disable cutpoints based on uniform frames
max_volume=500 ; any frame with sound volume larger than this will not be regarded as black frame
min_silence=12 ; Any deep silence longer than this amount of frames is a possible cutpoint
ticker_tape=0 ; Amount of pixels from bottom to ignore in all processing
logo_at_bottom=0 ; Set to 1 to search only for logo at the lower half of the video, do not combine with subtitle setting
punish=0 ; Compare to average for sum of 1=brightness, 2=uniform 4=volume, 8=silence, 16=schange, set to 0 to disable
punish_threshold=1.3 ; Multiply when amount is above average * punish_threshold
punish_modifier=2 ; When above average * threshold multiply score by this value
intelligent_brightness=0 ; Set to 1 to use a USA specific algorithm to tune some of the settings, not adviced outside the USA
logo_percentile=0.92 ; if more then this amount of logo is found then logo detection will be disabled
logo_threshold=0.75
punish_no_logo=1 ; Default, set to 0 to avoid show segments without logo to be scored towards commercial
aggressive_logo_rejection=0
connect_blocks_with_logo=1 ; set to 1 if you want successive blocks with logo on the transition to be regarded as connected, set to 0 to disable
logo_filter=0 ; set the size of the filter to apply to bad logo detection, 4 seems to be a good value.
cut_on_ar_change=1 ; set to 1 if you want to cut also on aspect ratio changes when logo is present, set to 2 to force cuts on aspect ratio changes. set to 0 to disable
delete_show_after_last_commercial=0 ; set to 1 if you want to delete the last block if its a show and after a commercial
delete_show_before_or_after_current=0 ; set to 1 if you want to delete the previous and the next show in the recording, this can lead to the deletion of trailers of next show
delete_block_after_commercial=0 ;set to max size of block in seconds to be discarded, set to 0 to disable
remove_before=0 ; amount of seconds of show to be removed before ALL commercials
remove_after=0 ; amount of seconds of show to be removed after ALL commercials
shrink_logo=5 ; Reduce the duration of the logo with this amount of seconds
after_logo=0 ; set to number of seconds after logo disappears comskip should start to search for silence to insert an additional cutpoint
padding=0
ms_audio_delay=5
volume_slip=40
skip_b_frames=0 ; Set to 1 to force Comskip to skip frames for higher processing speed.
max_repair_size=200 ; Will repair maximum 200 missing MPEG frames in the timeline, set to 0 to disable repairing for players that don't use PTS.
disable_heuristics=4 ;bit pattern for disabling heuristics, adding 1 disables heristics 1, adding 2 disables heristics 2, adding 4 disables heristics 3, 255 disables all heuristics
delete_logo_file=0 ; set to 1 if you want comskip to tidy up after finishing
output_framearray=1 ; create a big excel file for detailed analysis, set to 0 to disable
output_data=0 ; create a dump of the user data channel, used for CC and XDS (such as V-Chip info). Can be use together with output_framearray to remote debug CC decoding
output_videoredo=0
output_womble=0
output_mls=0 ; set to 1 if you want MPeg Video Wizard bookmark file output
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 ; Set to 1 if you're running DVRMS-Toolbox
output_edlx=0
output_vcf=0
output_bsplayer=0
output_btv=0 ; set to 1 if you want Beyond TV chapter cutlist output
output_projectx=0 ; set to 1 if you want ProjectX cutlist output (Xcl)
output_avisynth=0
output_vdr=0 ; set to 1 if you want XBMC to skipping commercials
output_demux=0 ; set to 1 if you want comskip to demux the mpeg file while scanning
sage_framenumber_bug=0
sage_minute_bug=0
live_tv=0 ; set to 1 if you use parallelprocessing and need the output while recording
live_tv_retries=4 ; change to 16 when using live_tv in BTV, used for mpeg PS and TS
dvrms_live_tv_retries=300 ; only used for dvr_ms
standoff=0 ; change to 8000000 when using live_tv in BTV
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"
erik
Site Admin
Posts: 3368
Joined: Sun Aug 21, 2005 3:49 pm

Re: My laptop detects commercials but my Raspberry pi doesn'

Post by erik »

Both audio and video are decoded in a substantially different way (e.g. resulting in different audio and video) so do not expect the same results.
You need to tune specifically for raspberry
padillaj3
Posts: 11
Joined: Sun Dec 04, 2016 12:01 am

Re: My laptop detects commercials but my Raspberry pi doesn'

Post by padillaj3 »

Ok thanks for the advice, I will keep tweaking the .ini file for the Raspberry pi individually, I have been trying different settings but was going under the assumption that if it worked on one it should work on the other. If I find settings that work with the Raspberry pi I will post an update.
Post Reply