Opened 6 years ago

Closed 2 years ago

#13335 closed Patch - Feature (Trac EOL)

mythcommflag: add 3 settings to enhance logo detection

Reported by: hamelg Owned by: cpinkham
Priority: minor Milestone: needs_triage
Component: MythTV - Mythcommflag Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This ticket is related to the PR : https://github.com/MythTV/mythtv/pull/172

My patch allows to spot where to lookup the logo.

  • CommDetectLogoLocation: Choices include N (North), S (South), E (East), W (West). The direction you choose specifies where to lookup the logo.
  • CommDetectLogoWidthRatio: To specify the maximum width of the logo.
  • CommDetectLogoHeightRatio: To specify the maximum height of the logo.

_

For the french TV channels, the reliable method to flag commercials is by logo detection. Unfortunately, the current method works fine if there is a only one logo displayed. The CSA is the French public authority of regulation of the audio-visual one. It adds another logo to protect children against harmful program. Here is a example here [1], the CSA logo is located at the bottom right corner.

Below is my commercial flagging setup and it works very fine :

CommDetectLogoSamplesNeeded=240
CommDetectLogoSampleSpacing=15
CommDetectLogoLocation=NE
CommDetectLogoWidthRatio=6
CommDetectLogoHeightRatio=8
CommDetectLogoBorder=64
CommDetectLogoGoodEdgeThreshold=0.80
CommercialSkipMethod=4

[1] https://app.box.com/s/qwzowxodbcee0y05s6cejip75ukdrnta

Attachments (2)

mythcommflag.out (13.7 KB) - added by hamelg 5 years ago.
output.txt (127.5 KB) - added by hamelg 5 years ago.

Download all attachments as: .zip

Change History (21)

comment:1 Changed 5 years ago by warpme

Hi,

This is excellent idea as here in Poland we have exactly the same regulation and by this logo detection totally fails in Poland for me.

I remember, I asked for feature of defining logo placement in algorithm 5 or 6 years ago... now I see You implemented this and this is fantastic.

I applied Your patch to current master, add in DB settings params as You listed in this ticket and tried commflaging. Test was on SD channel where logo is in right upper cornet (place is quite similar to mkv You provided; pls see yellow "16" in http://pasteall.org/pic/4519418035b37f4ae264eeac9152d83d).

commflag cmd line is following:

mythcommflag --loglevel debug --verbose commflag --jobid 102750 --outputfile /var/log/ --outputmethod full --logpath /var/log/

Unfortunately in /var/log/mythcommflag log I see:

2018-10-26 20:45:01.094213 I [26042/26042] CoreContext ClassicLogoDetector.cpp:152 (searchForLogo) - Analyzing edge data
2018-10-26 20:45:01.096810 I [26042/26042] CoreContext ClassicLogoDetector.cpp:286 (SetLogoMaskArea) - SetLogoMaskArea()
2018-10-26 20:45:01.098608 I [26042/26042] CoreContext ClassicLogoDetector.cpp:286 (SetLogoMaskArea) - SetLogoMaskArea()
2018-10-26 20:45:01.100435 I [26042/26042] CoreContext ClassicLogoDetector.cpp:224 (searchForLogo) - Testing Logo area: topleft (714,570), bottomright (5,5)
2018-10-26 20:45:01.100449 I [26042/26042] CoreContext ClassicLogoDetector.cpp:270 (searchForLogo) - Rejecting Logo area: topleft (714,570), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-26 20:45:01.100984 N [26042/26042] CoreContext ClassicLogoDetector.cpp:277 (searchForLogo) - No suitable logo area found.

so probably DB params are wrong or I'm doing wrongly something else...

BTW: is there a way to get better logo detection debugging (or losing whole detection process)?

comment:2 Changed 5 years ago by hamelg

To see how and where the logo is detected, you can apply the diff on my branch here : https://github.com/hamelg/mythtv/tree/gha-debug

It comes from this patch : https://code.mythtv.org/trac/attachment/ticket/12308/mcf-display-debug.patch

Have you set CommDetectLogoSamplesNeeded and CommDetectLogoSampleSpacing well ?

comment:3 Changed 5 years ago by warpme

Ok, I merged all commflag sources from Your gha-debug to current master and recompile.

DB settings seems to be OK (IMHO)

mysql> select * from settings where value like "CommDetect%";
+---------------------------------+------+----------+
| value                           | data | hostname |
+---------------------------------+------+----------+
| CommDetectLogoBorder            | 64   | NULL     |
| CommDetectLogoGoodEdgeThreshold | 0.80 | NULL     |
| CommDetectLogoHeightRatio       | 8    | NULL     |
| CommDetectLogoLocation          | NE   | NULL     |
| CommDetectLogoSamplesNeeded     | 240  | NULL     |
| CommDetectLogoSampleSpacing     | 15   | NULL     |
| CommDetectLogoWidthRatio        | 6    | NULL     |
| CommDetectMaxCommBreakLength    | 660  | mythtv   |
+---------------------------------+------+----------+
8 rows in set (0.00 sec) 

Next I launched commflag on 1080i test recording (first 100MB of test recording is here http://warped.inet2.org/sample8.ts)

[root@mythtv log]# mythcommflag --skipdb --file /myth/tv/23809_20181025181500.ts --method logo --outputmethod full --outputfile -
MythTV Commercial Flagger, flagging commercials for:
    /myth/tv/23809_20181025181500.ts
2018-10-30 09:48:23.940451 C  mythcommflag version: (HEAD detached from 33e31a0) [v30-Pre-910-g1af2764-dirty-v9.7.3.debug] www.mythtv.org
2018-10-30 09:48:23.940494 C  Qt version: compile: 5.5.1, runtime: 5.5.1
2018-10-30 10:04:16.212022 E  decoding error End of file (-541478725)
commercialBreakListFor: /myth/tv/23809_20181025181500.ts
totalframecount: 149600
  frame     min/max/avg scene aspect format flags mark
         1:  -1/ -1/ -1  -1%   wide  normal blank
         2:  -1/ -1/ -1  -1%   wide  normal blank
         3:  -1/ -1/ -1  -1%   wide  normal blank
         4:  -1/ -1/ -1  -1%   wide  normal blank
         5:  -1/ -1/ -1  -1%   wide  normal blank
         6:  -1/ -1/ -1  -1%   wide  normal blank
         7:  -1/ -1/ -1  -1%   wide  normal blank
         8:  -1/ -1/ -1  -1%   wide  normal blank
         9:  -1/ -1/ -1  -1%   wide  normal blank
        10:  -1/ -1/ -1  -1%   wide  normal blank
        11:  -1/ -1/ -1  -1%   wide  normal blank
        12:  -1/ -1/ -1  -1%   wide  normal blank
        13:  -1/ -1/ -1  -1%   wide  normal blank
        14:  -1/ -1/ -1  -1%   wide  normal blank
        15:  -1/ -1/ -1  -1%   wide  normal blank
        16:  -1/ -1/ -1  -1%   wide  normal blank
        17:  -1/ -1/ -1  -1%   wide  normal blank
        18:  -1/ -1/ -1  -1%   wide  normal blank
        19:  -1/ -1/ -1  -1%   wide  normal blank
        20:  -1/ -1/ -1  -1%   wide  normal blank
        21:  -1/ -1/ -1  -1%   wide  normal blank
        22:  -1/ -1/ -1  -1%   wide  normal blank
        23:  -1/ -1/ -1  -1%   wide  normal blank
        24:  -1/ -1/ -1  -1%   wide  normal blank
        25:  -1/ -1/ -1  -1%   wide  normal blank
        26:  -1/ -1/ -1  -1%   wide  normal blank
        27:  -1/ -1/ -1  -1%   wide  normal blank
        28:  -1/ -1/ -1  -1%   wide  normal blank
        29:  -1/ -1/ -1  -1%   wide  normal blank
        30:  -1/ -1/ -1  -1%   wide  normal blank
        and many more lines of such error

this "-1" errors I have also with unpatched commflag - so I suspect issue is maybe ffmpeg resync related. I'm curious what Your's commflag will show on this recording....

By curiosity I tried patched commflag on 576i recording and results are the same :-(

comment:4 Changed 5 years ago by hamelg

I downloaded your sample.

I cut the 1st minute :

$ ffmpeg -i sample8.ts -vcodec copy -acodec copy -ss 00:01:00 z.ts

Then I flagged with :

$ cat mythcommflag-override2
CommDetectLogoSamplesNeeded=30
CommDetectLogoSampleSpacing=2
commDetectLogoLocation=NE
commDetectLogoWidthRatio=6
commDetectLogoHeightRatio=8
CommDetectLogoBorder=64
CommercialSkipMethod=4

$ mythcommflag/mythcommflag --noprogress -v commflag:debug --override-settings-file mythcommflag-override2 --method 4  --skipdb --outputmethod full --outputfile output.txt -f ./z.ts

And it works !

To understand the meaning of the parameters and stats in the output file, reading the code and resources below should help :

You get -1 everywhere in output file because you have selected the logo method only. I have tested other methods and combinations, method=4 is the most reliable if a logo is available.

To enable the debug mode, you must uncomment

#define SHOW_DEBUG_WIN

in commercial_debug.h and recompile.

comment:5 Changed 5 years ago by warpme

Thx for replay. I'm trying to exactly replicate steeps You are doing:

[root@mythtv ~]# cat /etc/mythcommflag-override2
CommDetectLogoSamplesNeeded=30
CommDetectLogoSampleSpacing=2
commDetectLogoLocation=NE
commDetectLogoWidthRatio=6
commDetectLogoHeightRatio=8
CommDetectLogoBorder=64
CommercialSkipMethod=4

Next I launched commflaging exactly as You are doing:

mythcommflag --noprogress -v commflag:debug --override-settings-file /etc/mythcommflag-override2 --method 4  --skipdb --outputmethod full --outputfile /var/log/output.txt -f /myth/tv/23809_20181025181500.ts

console output is following:

[root@mythtv etc]# mythcommflag --noprogress -v commflag:debug --override-settings-file /etc/mythcommflag-override2 --method 4  --skipdb --outputmethod full --outputfile /var/log/output.txt -f /myth/tv/23809_20181025181500.ts
MythTV Commercial Flagger, flagging commercials for:
    /myth/tv/23809_20181025181500.ts
2018-10-31 10:13:10.020860 C  mythcommflag version: (HEAD detached from 33e31a0) [v30-Pre-915-g2ce3cd7-dirty-v9.7.3.debug] www.mythtv.org
2018-10-31 10:13:10.020878 C  Qt version: compile: 5.5.1, runtime: 5.5.1
2018-10-31 10:13:10.020880 N  Enabled verbose msgs:  general commflag
2018-10-31 10:13:10.020890 N  Setting Log Level to LOG_INFO
2018-10-31 10:13:10.031308 I  Added logging to the console
2018-10-31 10:13:10.031579 I  Setup Interrupt handler
2018-10-31 10:13:10.031588 I  Setup Terminated handler
2018-10-31 10:13:10.031592 I  Setup Segmentation fault handler
2018-10-31 10:13:10.031598 I  Setup Aborted handler
2018-10-31 10:13:10.031602 I  Setup Bus error handler
2018-10-31 10:13:10.031607 I  Setup Floating point exception handler
2018-10-31 10:13:10.031612 I  Setup Illegal instruction handler
2018-10-31 10:13:10.031617 I  Setup Real-time signal 0 handler
2018-10-31 10:13:10.031623 I  Setup Hangup handler
2018-10-31 10:13:10.031704 N  Using runtime prefix = /usr
2018-10-31 10:13:10.031707 N  Using configuration directory = /root/.mythtv
2018-10-31 10:13:10.031761 I  Assumed character encoding: en_US.UTF8
2018-10-31 10:13:10.031766 W  This application expects to be running a locale that specifies a UTF-8 codeset, and many features may behave improperly with your current language settings. Please set the LC_ALL or LC_CTYPE, and LANG variable(s) in the environment in which this program is executed to include a UTF-8 codeset (such as 'en_US.UTF-8').
2018-10-31 10:13:10.032052 N  Setting QT default locale to en_US
2018-10-31 10:13:10.032062 I  Current locale en_US
2018-10-31 10:13:10.032112 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2018-10-31 10:13:10.032659 N  Setting 'CommDetectLogoBorder' being forced to '64'
2018-10-31 10:13:10.032665 N  Setting 'CommDetectLogoSampleSpacing' being forced to '2'
2018-10-31 10:13:10.032672 N  Setting 'CommDetectLogoSamplesNeeded' being forced to '30'
2018-10-31 10:13:10.032676 N  Setting 'CommercialSkipMethod' being forced to '4'
2018-10-31 10:13:10.032680 N  Setting 'commDetectLogoHeightRatio' being forced to '8'
2018-10-31 10:13:10.032685 N  Setting 'commDetectLogoLocation' being forced to 'NE'
2018-10-31 10:13:10.032689 N  Setting 'commDetectLogoWidthRatio' being forced to '6'
2018-10-31 10:13:10.033778 I  Loading en_us translation for module mythfrontend
2018-10-31 10:13:10.317806 I  AFD: codec MP2 has 2 channels
2018-10-31 10:13:10.318598 I  AFD: Opened codec 0xa52740, id(MP2) type(Audio)
2018-10-31 10:13:10.318846 I  AFD: codec AC3 has 2 channels
2018-10-31 10:13:10.319096 I  AFD: Opened codec 0xa76780, id(AC3) type(Audio)
2018-10-31 10:13:10.319182 I  AFD: Opened codec 0xa7a8c0, id(DVB_SUBTITLE) type(Subtitle)
2018-10-31 10:13:10.320970 I  AFD: Using ffmpeg for video decoding
2018-10-31 10:13:10.321103 I  AFD: Opened codec 0xa7dbc0, id(H264) type(Video)
2018-10-31 10:13:10.321374 I  Commercial Detection initialized: width = 1920, height = 1080, fps = 50, method = 4
2018-10-31 10:13:10.321380 I  Using Sample Spacing of 10 horizontal & 10 vertical pixels.
2018-10-31 10:13:10.321400 I  CommDetect::ClearAllMaps()
Finding Logo2018-10-31 10:13:10.350830 I  Finding Logo
2018-10-31 10:13:10.350836 I  Searching for Station Logo
2018-10-31 10:13:10.350850 I  Trying with edgeDiff == 5, minPixelsInMask=1800
2018-10-31 10:13:10.489646 I  MythCodecContext: Disabled hardware decoder based deinterlacer.
2018-10-31 10:13:15.496896 I  Analyzing edge data
2018-10-31 10:13:15.502910 I  SetLogoMaskArea()
2018-10-31 10:13:15.508442 I  SetLogoMaskArea()
2018-10-31 10:13:15.513488 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:15.513499 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (4). Not within specified limits.
2018-10-31 10:13:15.513503 I  Trying with edgeDiff == 7, minPixelsInMask=1800
2018-10-31 10:13:20.086232 I  Analyzing edge data
2018-10-31 10:13:20.092480 I  SetLogoMaskArea()
2018-10-31 10:13:20.097427 I  SetLogoMaskArea()
2018-10-31 10:13:20.102495 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:20.102506 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:20.102509 I  Trying with edgeDiff == 10, minPixelsInMask=1800
2018-10-31 10:13:24.666688 I  Analyzing edge data
2018-10-31 10:13:24.672699 I  SetLogoMaskArea()
2018-10-31 10:13:24.677738 I  SetLogoMaskArea()
2018-10-31 10:13:24.683171 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:24.683182 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:24.683185 I  Trying with edgeDiff == 15, minPixelsInMask=1800
2018-10-31 10:13:29.242539 I  Analyzing edge data
2018-10-31 10:13:29.248587 I  SetLogoMaskArea()
2018-10-31 10:13:29.253788 I  SetLogoMaskArea()
2018-10-31 10:13:29.258865 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:29.258876 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:29.258879 I  Trying with edgeDiff == 20, minPixelsInMask=1800
2018-10-31 10:13:33.827150 I  Analyzing edge data
2018-10-31 10:13:33.833160 I  SetLogoMaskArea()
2018-10-31 10:13:33.838134 I  SetLogoMaskArea()
2018-10-31 10:13:33.843125 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:33.843137 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:33.843140 I  Trying with edgeDiff == 30, minPixelsInMask=1800
2018-10-31 10:13:38.405814 I  Analyzing edge data
2018-10-31 10:13:38.411949 I  SetLogoMaskArea()
2018-10-31 10:13:38.417275 I  SetLogoMaskArea()
2018-10-31 10:13:38.422365 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:38.422377 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:38.422380 I  Trying with edgeDiff == 40, minPixelsInMask=1800
2018-10-31 10:13:42.982916 I  Analyzing edge data
2018-10-31 10:13:42.989149 I  SetLogoMaskArea()
2018-10-31 10:13:42.994243 I  SetLogoMaskArea()
2018-10-31 10:13:42.999513 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:42.999525 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:42.999529 I  Trying with edgeDiff == 50, minPixelsInMask=1800
2018-10-31 10:13:47.540781 I  Analyzing edge data
2018-10-31 10:13:47.546829 I  SetLogoMaskArea()
2018-10-31 10:13:47.551782 I  SetLogoMaskArea()
2018-10-31 10:13:47.556766 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:47.556776 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:47.556780 I  Trying with edgeDiff == 60, minPixelsInMask=1800
2018-10-31 10:13:52.142945 I  Analyzing edge data
2018-10-31 10:13:52.148939 I  SetLogoMaskArea()
2018-10-31 10:13:52.153925 I  SetLogoMaskArea()
2018-10-31 10:13:52.158951 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 10:13:52.158963 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 10:13:52.159157 N  No suitable logo area found.
2018-10-31 10:13:52.219434 I  CommDetect::SetVideoParams called with aspect = 1.77778
2018-10-31 10:13:52.669802 I  0% Completed @ 222.222 fps.
2018-10-31 10:15:46.006557 I  10% Completed @ 131.825 fps.
2018-10-31 10:17:43.989089 I  20% Completed @ 129.439 fps.
2018-10-31 10:19:32.026844 I  30% Completed @ 132.134 fps.
2018-10-31 10:21:20.738539 I  40% Completed @ 133.551 fps.
2018-10-31 10:23:03.430788 E  decoding error End of file (-541478725)
2018-10-31 10:23:03.433526 I  CommDetect::GetCommBreakMap()
2018-10-31 10:23:03.433531 I  CommDetect::CleanupFrameInfo()
2018-10-31 10:23:03.433541 I  ClassicCommDetect: Only found 0 blank frames but wanted at least 29, rechecking data using higher threshold.
2018-10-31 10:23:03.449349 I  Minimum Average Brightness on a frame was -1, will use 2 as new threshold
2018-10-31 10:23:03.536168 I  Found 74789 blank frames using new value
2018-10-31 10:23:03.747466 I  CommDetect::GetLogoCommBreakMap()
2018-10-31 10:23:03.758922 I  Logo Commercial Break Map
2018-10-31 10:23:03.758927 I  Final Commercial Break Map
0
2018-10-31 10:23:04.970544 N  Finished, 0 break(s) found.

content of /var/log/output.txt

cat /var/log/output.txt
commercialBreakListFor: /myth/tv/23809_20181025181500.ts
totalframecount: 149600
  frame     min/max/avg scene aspect format flags mark
         1:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         2:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         3:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         4:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         5:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         6:  -1/ -1/ -1  -1%   wide  normal blank
         7:  -1/ -1/ -1  -1%   wide  normal blank
         8:  -1/ -1/ -1  -1%   wide  normal blank
         9:  -1/ -1/ -1  -1%   wide  normal blank
        10:  -1/ -1/ -1  -1%   wide  normal blank
        11:  -1/ -1/ -1  -1%   wide  normal blank
        12:  -1/ -1/ -1  -1%   wide  normal blank
        13:  -1/ -1/ -1  -1%   wide  normal blank
        14:  -1/ -1/ -1  -1%   wide  normal blank
        15:  -1/ -1/ -1  -1%   wide  normal blank
        16:  -1/ -1/ -1  -1%   wide  normal blank
        17:  -1/ -1/ -1  -1%   wide  normal blank
        18:  -1/ -1/ -1  -1%   wide  normal blank
        19:  -1/ -1/ -1  -1%   wide  normal blank
        20:  -1/ -1/ -1  -1%   wide  normal blank
        21:  -1/ -1/ -1  -1%   wide  normal blank
        22:  -1/ -1/ -1  -1%   wide  normal blank
        23:  -1/ -1/ -1  -1%   wide  normal blank
        24:  -1/ -1/ -1  -1%   wide  normal blank
        25:  -1/ -1/ -1  -1%   wide  normal blank
        26:  -1/ -1/ -1  -1%   wide  normal blank
        27:  -1/ -1/ -1  -1%   wide  normal blank
        28:  -1/ -1/ -1  -1%   wide  normal blank
        29:  -1/ -1/ -1  -1%   wide  normal blank
        30:  -1/ -1/ -1  -1%   wide  normal blank
        31:  -1/ -1/ -1  -1%   wide  normal blank
        32:  -1/ -1/ -1  -1%   wide  normal blank
        33:  -1/ -1/ -1  -1%   wide  normal blank
        34:  -1/ -1/ -1  -1%   wide  normal blank
        35:  -1/ -1/ -1  -1%   wide  normal blank
        36:  -1/ -1/ -1  -1%   wide  normal blank

I'm not sure - is this OK (expected)?

I tried commflaging with first 15min of recording trimmed via ffmpeg (exactly like You done):

ffmpeg -i /myth/tv/23809_20181025181500.ts -vcodec copy -acodec copy -ss 00:15:00 /myth/tv/23809_20181025181500-1.ts

Results are the same :-(

Also I tried to recompile with #define SHOW_DEBUG_WIN but launching commflag gives me segfault. Segfault trace is following:

----Proces trace------------------------------------------------------

generally: I scratching my head why commflaging on my recording is working OK for You but not for me?
I'm on current master (as of g2ce3cd7) with programs/commflag sources replaced to Your repo.

pls advise 
GNU gdb (GDB) 7.10.1
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/mythcommflag...done.
[New LWP 26853]
[New LWP 26854]
[New LWP 26857]
[New LWP 26856]
[New LWP 26855]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `mythcommflag --noprogress -v commflag:debug --override-settings-file /etc/mythc'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000000000045a522 in comm_debug_init (width=1920, height=1080)
    at commercial_debug.cpp:41
[Current thread is 1 (Thread 0x7fcb779d8800 (LWP 26853))]

Thread 5 (Thread 0x7fcb7702b700 (LWP 26855)):
#0  0x00007fcb86713428 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
No symbol table info available.
#1  0x00007fcb869c9d66 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#2  0x00007fcb8df5b493 in LogForwardThread::run (this=0x7fcb70003a80) at loggingserver.cpp:1208
        lock = {val = 140512239824873}
        processed = 1
        loggers = {<QListSpecialMethods<LoggerBase*>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x0}, d = 0x0}}
#3  0x00007fcb8de7283f in MThreadInternal::run (this=0x7fcb70003d30) at mthread.cpp:79
No locals.
#4  0x00007fcb869c8b8e in ?? () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#5  0x00007fcb8670d4a4 in start_thread () from /usr/lib/libpthread.so.0
No symbol table info available.
#6  0x00007fcb85bb4dcd in clone () from /usr/lib/libc.so.6
No symbol table info available.

Thread 4 (Thread 0x7fcb7682a700 (LWP 26856)):
#0  0x00007fcb86713428 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
No symbol table info available.
#1  0x00007fcb869c9d66 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#2  0x00007fcb8df4e658 in LoggerThread::run (this=0x1f57880) at logging.cpp:399
        item = 0x1f6cd00
        __FUNCTION__ = "run"
        dieNow = false
        qLock = {val = 140512239824697}
#3  0x00007fcb8de7283f in MThreadInternal::run (this=0x1f54720) at mthread.cpp:79
No locals.
#4  0x00007fcb869c8b8e in ?? () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#5  0x00007fcb8670d4a4 in start_thread () from /usr/lib/libpthread.so.0
No symbol table info available.
#6  0x00007fcb85bb4dcd in clone () from /usr/lib/libc.so.6
No symbol table info available.

Thread 3 (Thread 0x7fcb67fff700 (LWP 26857)):
#0  0x00007fcb86713428 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
No symbol table info available.
#1  0x00007fcb869c9fee in QWaitCondition::wait(QReadWriteLock*, unsigned long) () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#2  0x00007fcb8e8797fc in RingBuffer::run (this=0x1f72540) at ringbuffer.cpp:983
        totfree = 32767
        KB32 = 32768
        KB512 = 524288
        read_return = 65536
        reads_were_allowed = true
        isopened = true
        used = 4161537
        lastread = {tv_sec = 1540983458, tv_usec = 821465}
        now = {tv_sec = 1540983458, tv_usec = 821465}
        readtimeavg = 187
        ignore_for_read_timing = true
        eofreads = 0
        __FUNCTION__ = "run"
#3  0x00007fcb8de7283f in MThreadInternal::run (this=0x1f70f40) at mthread.cpp:79
No locals.
#4  0x00007fcb869c8b8e in ?? () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#5  0x00007fcb8670d4a4 in start_thread () from /usr/lib/libpthread.so.0
No symbol table info available.
#6  0x00007fcb85bb4dcd in clone () from /usr/lib/libc.so.6
No symbol table info available.

Thread 2 (Thread 0x7fcb7782c700 (LWP 26854)):
#0  0x00007fcb85babe5d in poll () from /usr/lib/libc.so.6
No symbol table info available.
#1  0x00007fcb80a02fbc in ?? () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#2  0x00007fcb80a030cc in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
No symbol table info available.
#3  0x00007fcb86c0056b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#4  0x00007fcb86ba757a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#5  0x00007fcb869c3be4 in QThread::exec() () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#6  0x00007fcb8de72883 in MThreadInternal::exec (this=0x1f57930) at mthread.cpp:85
        ph = {<QObject> = {<No data fields>}, purgeTimer = 1}
#7  0x00007fcb8de71fa0 in MThread::exec (this=0x1f57db0) at mthread.cpp:331
No locals.
#8  0x00007fcb8df5aac8 in LogServerThread::run (this=0x1f57da0) at loggingserver.cpp:898
        locker = {val = 140512239824808}
        abortThread = false
#9  0x00007fcb8de7283f in MThreadInternal::run (this=0x1f57930) at mthread.cpp:79
No locals.
#10 0x00007fcb869c8b8e in ?? () from /usr/lib/libQt5Core.so.5
No symbol table info available.
#11 0x00007fcb8670d4a4 in start_thread () from /usr/lib/libpthread.so.0
No symbol table info available.
#12 0x00007fcb85bb4dcd in clone () from /usr/lib/libc.so.6
No symbol table info available.

Thread 1 (Thread 0x7fcb779d8800 (LWP 26853)):
#0  0x000000000045a522 in comm_debug_init (width=1920, height=1080) at commercial_debug.cpp:41
        comm_screen = 0x40f905 <QString::~QString()+49>
        comm_screen_num = 32765
#1  0x0000000000411cc7 in ClassicCommDetector::Init (this=0x1fc9290) at ClassicCommDetector.cpp:210
        video_disp_dim = {wd = 1920, ht = 1080}
        __FUNCTION__ = "Init"
#2  0x0000000000412c0e in ClassicCommDetector::go (this=0x1fc9290) at ClassicCommDetector.cpp:332
        secsSince = 14401
        requiredBuffer = 30
        requiredHeadStart = 30
        wereRecording = false
        __FUNCTION__ = "go"
        flagTime = {mds = 1}
        myTotalFrames = 4294967295
        flagFPS = 0.000437094073
        currentFrameNumber = 140727938970736
        aspect = 0
        newAspect = 9.026658e-38
        prevpercent = 33293504
#3  0x000000000045f997 in DoFlagCommercials (program_info=0x7ffdc6cff9e0, showPercentage=true, fullSpeed=true, jobid=-1, cfp=0x1f7efd0, commDetectMethod=COMM_DETECT_LOGO, outputfilename=..., useDB=false) at main.cpp:568
        factory = {<No data fields>}
        __FUNCTION__ = "DoFlagCommercials"
        cer = 0x1f5baa0
        a = 0x1fbf190
        b = 0x1fc9cd0
        c = 0x1fc04c0
        result = false
        comms_found = 0
        tmp = 0x7ffdc6cff520
#4  0x0000000000462250 in FlagCommercials (program_info=0x7ffdc6cff9e0, jobid=-1, outputfilename=..., useDB=false, fullSpeed=true) at main.cpp:925
        breaksFound = 0
        commDetectMethod = COMM_DETECT_LOGO
        __FUNCTION__ = "FlagCommercials"
        blanks = {d = 0x7fcb86cbe300 <QMapDataBase::shared_null>}
        filename = {static null = {<No data fields>}, d = 0x1f711d0}
        tmprbuf = 0x1f72540
        flags = (kDecodeLowRes | kDecodeSingleThreaded | kDecodeNoLoopFilter | kVideoIsNull | kAudioMuted | kNoITV)
        cfp = 0x1f7efd0
        ctx = 0x1fcc920
#5  0x000000000046323e in FlagCommercials (filename=..., jobid=-1, outputfilename=..., useDB=false, fullSpeed=true) at main.cpp:992
        pginfo = {_vptr.ProgramInfo = 0x7fcb8d96d2c8 <vtable for ProgramInfo+16>, title = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, subtitle = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, description = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, season = 0, episode = 0, totalepisodes = 0, syndicatedepisode = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, category = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, director = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, recpriority = 0, chanid = 0, chanstr = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, chansign = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, channame = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, chanplaybackfilters = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, recgroup = {static null = {<No data fields>}, d = 0x1f5b3e0}, playgroup = {static null = {<No data fields>}, d = 0x1f5b370}, pathname = {static null = {<No data fields>}, d = 0x1f711d0}, hostname = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, storagegroup = {static null = {<No data fields>}, d = 0x1f5adc0}, seriesid = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, programid = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, inetref = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, catType = ProgramInfo::kCategoryNone, filesize = 0, startts = {d = {d = 0x1f5ace0}}, endts = {d = {d = 0x1f5e550}}, recstartts = {d = {d = 0x1f5ace0}}, recendts = {d = {d = 0x1f5e550}}, stars = 0, originalAirDate = {jd = -9223372036854775808}, lastmodified = {d = {d = 0x1f59770}}, lastInUseTime = {d = {d = 0x1f5ab90}}, recpriority2 = 0, recordid = 0, parentid = 0, sourceid = 0, inputid = 0, findid = 0, programflags = 1048576, properties = 0, year = 0, partnumber = 0, parttotal = 0, recstatus = 0 '\000', rectype = 0 '\000', dupin = 15 '\017', dupmethod = 8 '\b', recordedid = 0, inputname = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, bookmarkupdate = {d = {d = 0x1f5b4c0}}, availableStatus = 0 '\000', progressPercent = 0, spread = -1 '\377', startCol = -1 '\377', sortTitle = {static null = {<No data fields>}, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, static kFromRecordedQuery = {static null = {<No data fields>}, d = 0x1f2cc60}, inUseForWhat = {static null = <same as static member of an already seen type>, d = 0x7fcb86c7d2e0 <QArrayData::shared_null>}, positionMapDBReplacement = 0x0, static staticDataLock = {<QBasicMutex> = {d_ptr = {_q_value = 0x0}}, <No data fields>}, static updater = 0x1f2cba0, static usingProgIDAuth = true}
#6  0x00000000004656b4 in main (argc=15, argv=0x7ffdc6d00448) at main.cpp:1249
        result = 0
        jobType = 0
        a = <incomplete type>
        retval = 0
        callCleanup = {m_cleanFunction = 0x45aae0 <(anonymous namespace)::cleanup()>}
        signallist = {<QListSpecialMethods<int>> = {<No data fields>}, {p = {static shared_null = {ref = {atomic = {_q_value = -1}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x1f59110}, d = 0x1f59110}}
        __FUNCTION__ = "main"
----------------------------------------------------------------------

I'm scratching my head why comflaging on my recording works ok for You but not for me? My comflag is based on current master with programs/comflag sources dir replaced to dir from your repo. Maybe I should use your code differently?

pls advise

comment:6 Changed 5 years ago by warpme

Ah - one remark: console log in comment#5 is from ffmpeg trimmed recording. Thats why You see only 40% of progress.

2018-10-31 10:13:52.669802 I  0% Completed @ 222.222 fps.
2018-10-31 10:15:46.006557 I  10% Completed @ 131.825 fps.
2018-10-31 10:17:43.989089 I  20% Completed @ 129.439 fps.
2018-10-31 10:19:32.026844 I  30% Completed @ 132.134 fps.
2018-10-31 10:21:20.738539 I  40% Completed @ 133.551 fps.
2018-10-31 10:23:03.430788 E  decoding error End of file (-541478725)

Output for full recording is exactly the same...

comment:7 Changed 5 years ago by warpme

FYI: I rebuild whole mythtv basing on Your sources (https://github.com/hamelg/mythtv/tree/gha-debug) and without any patches. Issue seems to be exactly the same. here is console log:

MythTV Commercial Flagger, flagging commercials for:
    /myth/tv/23809_20181025181500.ts
2018-10-31 13:40:16.887245 C  mythcommflag version: gha-debug [v30-Pre-3d30b916cfe] www.mythtv.org
2018-10-31 13:40:16.887265 C  Qt version: compile: 5.5.1, runtime: 5.5.1
2018-10-31 13:40:16.887267 N  Enabled verbose msgs:  general commflag
2018-10-31 13:40:16.887276 N  Setting Log Level to LOG_INFO
2018-10-31 13:40:16.897836 I  Added logging to the console
2018-10-31 13:40:16.898162 I  Setup Interrupt handler
2018-10-31 13:40:16.898173 I  Setup Terminated handler
2018-10-31 13:40:16.898179 I  Setup Segmentation fault handler
2018-10-31 13:40:16.898185 I  Setup Aborted handler
2018-10-31 13:40:16.898192 I  Setup Bus error handler
2018-10-31 13:40:16.898197 I  Setup Floating point exception handler
2018-10-31 13:40:16.898204 I  Setup Illegal instruction handler
2018-10-31 13:40:16.898210 I  Setup Real-time signal 0 handler
2018-10-31 13:40:16.898218 I  Setup Hangup handler
2018-10-31 13:40:16.898314 N  Using runtime prefix = /usr
2018-10-31 13:40:16.898317 N  Using configuration directory = /root/.mythtv
2018-10-31 13:40:16.898374 I  Assumed character encoding: en_US.UTF8
2018-10-31 13:40:16.898380 W  This application expects to be running a locale that specifies a UTF-8 codeset, and many features may behave improperly with your current language settings. Please set the LC_ALL or LC_CTYPE, and LANG variable(s) in the environment in which this program is executed to include a UTF-8 codeset (such as 'en_US.UTF-8').
2018-10-31 13:40:16.898665 N  Setting QT default locale to en_US
2018-10-31 13:40:16.898674 I  Current locale en_US
2018-10-31 13:40:16.898706 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2018-10-31 13:40:16.899436 N  Setting 'CommDetectLogoBorder' being forced to '64'
2018-10-31 13:40:16.899445 N  Setting 'CommDetectLogoSampleSpacing' being forced to '2'
2018-10-31 13:40:16.899453 N  Setting 'CommDetectLogoSamplesNeeded' being forced to '30'
2018-10-31 13:40:16.899459 N  Setting 'CommercialSkipMethod' being forced to '4'
2018-10-31 13:40:16.899465 N  Setting 'commDetectLogoHeightRatio' being forced to '8'
2018-10-31 13:40:16.899471 N  Setting 'commDetectLogoLocation' being forced to 'NE'
2018-10-31 13:40:16.899476 N  Setting 'commDetectLogoWidthRatio' being forced to '6'
2018-10-31 13:40:16.900227 I  Loading en_us translation for module mythfrontend
Finding Logo2018-10-31 13:40:17.157176 I  AFD: codec MP2 has 2 channels
2018-10-31 13:40:17.158664 I  AFD: Opened codec 0xdd0040, id(MP2) type(Audio)
2018-10-31 13:40:17.158969 I  AFD: codec AC3 has 2 channels
2018-10-31 13:40:17.159345 I  AFD: Opened codec 0xdc3080, id(AC3) type(Audio)
2018-10-31 13:40:17.159445 I  AFD: Opened codec 0xdd56c0, id(DVB_SUBTITLE) type(Subtitle)
2018-10-31 13:40:17.159604 I  AFD: Using ffmpeg for video decoding
2018-10-31 13:40:17.159737 I  AFD: Opened codec 0xdd64c0, id(H264) type(Video)
2018-10-31 13:40:17.160084 I  Commercial Detection initialized: width = 1920, height = 1080, fps = 50, method = 4
2018-10-31 13:40:17.160093 I  Using Sample Spacing of 10 horizontal & 10 vertical pixels.
2018-10-31 13:40:17.160116 I  CommDetect::ClearAllMaps()
2018-10-31 13:40:17.195132 I  Finding Logo
2018-10-31 13:40:17.195138 I  Searching for Station Logo
2018-10-31 13:40:17.195149 I  Trying with edgeDiff == 5, minPixelsInMask=1800
2018-10-31 13:40:17.346299 I  MythCodecContext: Disabled hardware decoder based deinterlacer.
2018-10-31 13:40:22.875773 I  Analyzing edge data
2018-10-31 13:40:22.882108 I  SetLogoMaskArea()
2018-10-31 13:40:22.887979 I  SetLogoMaskArea()
2018-10-31 13:40:22.893286 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:22.893296 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (4). Not within specified limits.
2018-10-31 13:40:22.893299 I  Trying with edgeDiff == 7, minPixelsInMask=1800
2018-10-31 13:40:28.168219 I  Analyzing edge data
2018-10-31 13:40:28.174568 I  SetLogoMaskArea()
2018-10-31 13:40:28.179769 I  SetLogoMaskArea()
2018-10-31 13:40:28.184990 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:28.185002 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:40:28.185006 I  Trying with edgeDiff == 10, minPixelsInMask=1800
2018-10-31 13:40:33.014690 I  Analyzing edge data
2018-10-31 13:40:33.020929 I  SetLogoMaskArea()
2018-10-31 13:40:33.026587 I  SetLogoMaskArea()
2018-10-31 13:40:33.031891 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:33.031902 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:40:33.031906 I  Trying with edgeDiff == 15, minPixelsInMask=1800
2018-10-31 13:40:37.883711 I  Analyzing edge data
2018-10-31 13:40:37.889975 I  SetLogoMaskArea()
2018-10-31 13:40:37.895272 I  SetLogoMaskArea()
2018-10-31 13:40:37.900502 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:37.900512 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:40:37.900515 I  Trying with edgeDiff == 20, minPixelsInMask=1800
2018-10-31 13:40:42.715928 I  Analyzing edge data
2018-10-31 13:40:42.722408 I  SetLogoMaskArea()
2018-10-31 13:40:42.727918 I  SetLogoMaskArea()
2018-10-31 13:40:42.733123 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:42.733133 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:40:42.733136 I  Trying with edgeDiff == 30, minPixelsInMask=1800
2018-10-31 13:40:47.588728 I  Analyzing edge data
2018-10-31 13:40:47.594996 I  SetLogoMaskArea()
2018-10-31 13:40:47.600298 I  SetLogoMaskArea()
2018-10-31 13:40:47.605765 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:47.605776 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:40:47.605779 I  Trying with edgeDiff == 40, minPixelsInMask=1800
2018-10-31 13:40:52.438946 I  Analyzing edge data
2018-10-31 13:40:52.445310 I  SetLogoMaskArea()
2018-10-31 13:40:52.450462 I  SetLogoMaskArea()
2018-10-31 13:40:52.455661 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:52.455672 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:40:52.455675 I  Trying with edgeDiff == 50, minPixelsInMask=1800
2018-10-31 13:40:57.282675 I  Analyzing edge data
2018-10-31 13:40:57.289064 I  SetLogoMaskArea()
2018-10-31 13:40:57.294274 I  SetLogoMaskArea()
2018-10-31 13:40:57.299514 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:40:57.299525 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:40:57.299529 I  Trying with edgeDiff == 60, minPixelsInMask=1800
2018-10-31 13:41:02.144710 I  Analyzing edge data
2018-10-31 13:41:02.151176 I  SetLogoMaskArea()
2018-10-31 13:41:02.156448 I  SetLogoMaskArea()
2018-10-31 13:41:02.161726 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-10-31 13:41:02.161737 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-10-31 13:41:02.163234 N  No suitable logo area found.
2018-10-31 13:41:02.223489 I  CommDetect::SetVideoParams called with aspect = 1.77778
2018-10-31 13:41:02.714147 I  0% Completed @ 203.666 fps.
2018-10-31 13:43:03.431237 I  10% Completed @ 123.754 fps.
2018-10-31 13:45:08.810609 I  20% Completed @ 121.661 fps.
2018-10-31 13:47:03.476671 I  30% Completed @ 124.29 fps.
2018-10-31 13:48:59.563634 I  40% Completed @ 125.487 fps.
2018-10-31 13:50:48.241641 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.247003 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.256679 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.267385 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.277006 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.286666 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.297360 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.306983 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.317683 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.327309 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.337035 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.347842 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.357562 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.367248 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.378006 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.387667 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.397291 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.407980 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.417640 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.428349 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.437985 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.448634 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.458293 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.467931 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.478654 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.488412 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.498094 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.508789 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.518415 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.529121 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.538761 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.548398 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.559087 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.568738 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.579422 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.589090 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.598799 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.609596 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.619340 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.629064 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.639857 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.649592 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.659318 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.670071 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.679768 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.689487 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.700277 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.709988 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.719714 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.729482 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.740258 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.749931 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.760630 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.770255 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.779920 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.790714 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.800432 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.810158 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.820976 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.830693 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.840446 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.851233 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.860966 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.870686 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.881393 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.891051 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.900737 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.911504 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.921154 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.931857 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.941485 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.951112 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.961815 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.971474 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.982155 E  decoding error End of file (-541478725)
2018-10-31 13:50:48.991800 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.001490 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.012199 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.021890 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.031585 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.042395 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.052142 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.061864 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.072644 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.082313 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.092027 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.102812 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.112525 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.122153 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.132855 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.142506 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.153227 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.162862 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.172512 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.183242 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.192882 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.203636 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.213355 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.223082 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.233817 E  decoding error End of file (-541478725)
2018-10-31 13:50:49.249668 I  CommDetect::GetCommBreakMap()
2018-10-31 13:50:49.250022 I  CommDetect::CleanupFrameInfo()
2018-10-31 13:50:49.250038 I  ClassicCommDetect: Only found 0 blank frames but wanted at least 29, rechecking data using higher threshold.
2018-10-31 13:50:49.271149 I  Minimum Average Brightness on a frame was -1, will use 2 as new threshold
2018-10-31 13:50:49.361144 I  Found 74790 blank frames using new value
2018-10-31 13:50:49.582222 I  CommDetect::GetLogoCommBreakMap()
2018-10-31 13:50:49.594316 I  Logo Commercial Break Map
2018-10-31 13:50:49.594321 I  Final Commercial Break Map
0
2018-10-31 13:50:50.857588 N  Finished, 0 break(s) found.

and output.txt

commercialBreakListFor: /myth/tv/23809_20181025181500.ts
totalframecount: 149600
  frame     min/max/avg scene aspect format flags mark
         1:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         2:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         3:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         4:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         5:  -1/ -1/ -1  -1%   wide  normal skipped,blank
         6:  -1/ -1/ -1  -1%   wide  normal blank
         7:  -1/ -1/ -1  -1%   wide  normal blank
         8:  -1/ -1/ -1  -1%   wide  normal blank
         9:  -1/ -1/ -1  -1%   wide  normal blank
        10:  -1/ -1/ -1  -1%   wide  normal blank
        11:  -1/ -1/ -1  -1%   wide  normal blank
        12:  -1/ -1/ -1  -1%   wide  normal blank
        13:  -1/ -1/ -1  -1%   wide  normal blank
        14:  -1/ -1/ -1  -1%   wide  normal blank
        15:  -1/ -1/ -1  -1%   wide  normal blank
        16:  -1/ -1/ -1  -1%   wide  normal blank
        17:  -1/ -1/ -1  -1%   wide  normal blank
        18:  -1/ -1/ -1  -1%   wide  normal blank
        19:  -1/ -1/ -1  -1%   wide  normal blank
        20:  -1/ -1/ -1  -1%   wide  normal blank
        21:  -1/ -1/ -1  -1%   wide  normal blank
        22:  -1/ -1/ -1  -1%   wide  normal blank
        23:  -1/ -1/ -1  -1%   wide  normal blank
        24:  -1/ -1/ -1  -1%   wide  normal blank
        25:  -1/ -1/ -1  -1%   wide  normal blank
        26:  -1/ -1/ -1  -1%   wide  normal blank
        27:  -1/ -1/ -1  -1%   wide  normal blank
        28:  -1/ -1/ -1  -1%   wide  normal blank
        29:  -1/ -1/ -1  -1%   wide  normal blank
        30:  -1/ -1/ -1  -1%   wide  normal blank

comment:8 Changed 5 years ago by hamelg

Replay exactly my test case on your sample, and you'll see it works. The logo detection works in 2 steps :

  • 1st : logo searching on a sample : If you see "No suitable logo area found." in logs, this step has failed and the flagging will not work.
  • 2nd : Apply the mask built at 1st step to check if the logo is displayed or not on each frame of the video.

The 2 params CommDetectLogoSamplesNeeded and CommDetectLogoSampleSpacing are very important at 1st step and must be set according the video length. They determine the sample used to search the logo.

CommDetectLogoSamplesNeeded=30
CommDetectLogoSampleSpacing=2

means look for logo every 2s, 30 times = It scans the first 60s of the video. It needs a success threshold to decide if a logo has been detected or not (see ClassicLogoDetector::searchForLogo() in ClassicLogoDetector.cpp)

comment:9 Changed 5 years ago by warpme

I tried Your branch ( gha-debug [v30-Pre-3d30b916cfe]) on my sample (http://warped.inet2.org/sample8.ts) with settings like this:

cat mythcommflag-override2
CommDetectLogoSamplesNeeded=30
CommDetectLogoSampleSpacing=2
CommDetectLogoLocation=NE
CommDetectLogoWidthRatio=6
CommDetectLogoHeightRatio=8
CommDetectLogoBorder=64
CommDetectLogoGoodEdgeThreshold=0.80
CommercialSkipMethod=4

with commandline:

mythcommflag --noprogress -v commflag:debug --override-settings-file /etc/mythcommflag-override2 --method 4  --skipdb --outputmethod full --outputfile /var/log/output.txt -f /var/http/sample8.ts

and result is:

mythcommflag --noprogress -v commflag:debug --override-settings-file /etc/mythcommflag-override2 --method 4  --skipdb --outputmethod full --outputfile /var/log/output.txt -f /var/http/sample8.ts
MythTV Commercial Flagger, flagging commercials for:
    /var/http/sample8.ts
2018-11-08 13:47:40.623983 C  mythcommflag version: gha-debug [v30-Pre-3d30b916cfe] www.mythtv.org
2018-11-08 13:47:40.624017 C  Qt version: compile: 5.5.1, runtime: 5.5.1
2018-11-08 13:47:40.624021 N  Enabled verbose msgs:  general commflag
2018-11-08 13:47:40.624039 N  Setting Log Level to LOG_INFO
2018-11-08 13:47:40.646498 I  Setup Interrupt handler
2018-11-08 13:47:40.646512 I  Setup Terminated handler
2018-11-08 13:47:40.646520 I  Setup Segmentation fault handler
2018-11-08 13:47:40.646529 I  Setup Aborted handler
2018-11-08 13:47:40.646536 I  Setup Bus error handler
2018-11-08 13:47:40.646545 I  Setup Floating point exception handler
2018-11-08 13:47:40.646553 I  Setup Illegal instruction handler
2018-11-08 13:47:40.646562 I  Setup Real-time signal 0 handler
2018-11-08 13:47:40.646573 I  Setup Hangup handler
2018-11-08 13:47:40.646710 N  Using runtime prefix = /usr
2018-11-08 13:47:40.646715 N  Using configuration directory = /root/.mythtv
2018-11-08 13:47:40.646804 I  Assumed character encoding: en_US.UTF8
2018-11-08 13:47:40.646811 W  This application expects to be running a locale that specifies a UTF-8 codeset, and many features may behave improperly with your current language settings. Please set the LC_ALL or LC_CTYPE, and LANG variable(s) in the environment in which this program is executed to include a UTF-8 codeset (such as 'en_US.UTF-8').
2018-11-08 13:47:40.647192 N  Setting QT default locale to en_US
2018-11-08 13:47:40.647204 I  Current locale en_US
2018-11-08 13:47:40.647246 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2018-11-08 13:47:40.647817 N  Setting 'CommDetectLogoBorder' being forced to '64'
2018-11-08 13:47:40.647827 N  Setting 'CommDetectLogoGoodEdgeThreshold' being forced to '0.80'
2018-11-08 13:47:40.647838 N  Setting 'CommDetectLogoHeightRatio' being forced to '8'
2018-11-08 13:47:40.647844 N  Setting 'CommDetectLogoLocation' being forced to 'NE'
2018-11-08 13:47:40.647853 N  Setting 'CommDetectLogoSampleSpacing' being forced to '2'
2018-11-08 13:47:40.647860 N  Setting 'CommDetectLogoSamplesNeeded' being forced to '30'
2018-11-08 13:47:40.647866 N  Setting 'CommDetectLogoWidthRatio' being forced to '6'
2018-11-08 13:47:40.647872 N  Setting 'CommercialSkipMethod' being forced to '4'
2018-11-08 13:47:40.647951 I  Loading en_us translation for module mythfrontend
2018-11-08 13:47:40.657868 I  Added logging to the console
Finding Logo2018-11-08 13:47:40.875083 I  AFD: codec MP2 has 2 channels
2018-11-08 13:47:40.876730 I  AFD: Opened codec 0x880340, id(MP2) type(Audio)
2018-11-08 13:47:40.876999 I  AFD: codec AC3 has 2 channels
2018-11-08 13:47:40.877266 I  AFD: Opened codec 0x881cc0, id(AC3) type(Audio)
2018-11-08 13:47:40.877365 I  AFD: Opened codec 0x884340, id(DVB_SUBTITLE) type(Subtitle)
2018-11-08 13:47:40.878599 I  AFD: Using ffmpeg for video decoding
2018-11-08 13:47:40.878706 I  AFD: Opened codec 0x884e00, id(H264) type(Video)
2018-11-08 13:47:40.879037 I  Commercial Detection initialized: width = 1920, height = 1080, fps = 50, method = 4
2018-11-08 13:47:40.879044 I  Using Sample Spacing of 10 horizontal & 10 vertical pixels.
2018-11-08 13:47:40.879067 I  CommDetect::ClearAllMaps()
2018-11-08 13:47:40.976579 I  Finding Logo
2018-11-08 13:47:40.976585 I  Searching for Station Logo
2018-11-08 13:47:40.976612 I  Trying with edgeDiff == 5, minPixelsInMask=1800
2018-11-08 13:47:41.259787 I  MythCodecContext: Disabled hardware decoder based deinterlacer.
2018-11-08 13:47:54.681998 I  Analyzing edge data
2018-11-08 13:47:54.694775 I  SetLogoMaskArea()
2018-11-08 13:47:54.728568 I  SetLogoMaskArea()
2018-11-08 13:47:54.737965 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:47:54.737982 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (4). Not within specified limits.
2018-11-08 13:47:54.737988 I  Trying with edgeDiff == 7, minPixelsInMask=1800
2018-11-08 13:48:05.264158 I  Analyzing edge data
2018-11-08 13:48:05.290038 I  SetLogoMaskArea()
2018-11-08 13:48:05.312691 I  SetLogoMaskArea()
2018-11-08 13:48:05.321524 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:48:05.321541 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:48:05.321548 I  Trying with edgeDiff == 10, minPixelsInMask=1800
2018-11-08 13:48:14.487058 I  Analyzing edge data
2018-11-08 13:48:14.515259 I  SetLogoMaskArea()
2018-11-08 13:48:14.524076 I  SetLogoMaskArea()
2018-11-08 13:48:14.550862 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:48:14.550879 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:48:14.550886 I  Trying with edgeDiff == 15, minPixelsInMask=1800
2018-11-08 13:48:23.959667 I  Analyzing edge data
2018-11-08 13:48:23.988556 I  SetLogoMaskArea()
2018-11-08 13:48:24.010918 I  SetLogoMaskArea()
2018-11-08 13:48:24.020115 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:48:24.020133 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:48:24.020140 I  Trying with edgeDiff == 20, minPixelsInMask=1800
2018-11-08 13:48:32.777320 I  Analyzing edge data
2018-11-08 13:48:32.805642 I  SetLogoMaskArea()
2018-11-08 13:48:32.814579 I  SetLogoMaskArea()
2018-11-08 13:48:32.834186 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:48:32.834205 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:48:32.834211 I  Trying with edgeDiff == 30, minPixelsInMask=1800
2018-11-08 13:48:42.406622 I  Analyzing edge data
2018-11-08 13:48:42.419626 I  SetLogoMaskArea()
2018-11-08 13:48:42.444387 I  SetLogoMaskArea()
2018-11-08 13:48:42.468224 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:48:42.468241 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:48:42.468247 I  Trying with edgeDiff == 40, minPixelsInMask=1800
2018-11-08 13:48:51.872341 I  Analyzing edge data
2018-11-08 13:48:51.894459 I  SetLogoMaskArea()
2018-11-08 13:48:51.916726 I  SetLogoMaskArea()
2018-11-08 13:48:51.939054 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:48:51.939072 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:48:51.939078 I  Trying with edgeDiff == 50, minPixelsInMask=1800
2018-11-08 13:49:01.268888 I  Analyzing edge data
2018-11-08 13:49:01.289209 I  SetLogoMaskArea()
2018-11-08 13:49:01.298792 I  SetLogoMaskArea()
2018-11-08 13:49:01.328893 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:49:01.328910 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:49:01.328916 I  Trying with edgeDiff == 60, minPixelsInMask=1800
2018-11-08 13:49:10.388408 I  Analyzing edge data
2018-11-08 13:49:10.411963 I  SetLogoMaskArea()
2018-11-08 13:49:10.433037 I  SetLogoMaskArea()
2018-11-08 13:49:10.455002 I  Testing Logo area: topleft (1914,1074), bottomright (5,5)
2018-11-08 13:49:10.455021 I  Rejecting Logo area: topleft (1914,1074), bottomright (5,5), pixelsInMask (0). Not within specified limits.
2018-11-08 13:49:10.459036 N  No suitable logo area found.
2018-11-08 13:49:10.570011 I  CommDetect::SetVideoParams called with aspect = 1.77778
2018-11-08 13:49:47.367649 I  40% Completed @ 67.9385 fps.
2018-11-08 13:49:57.530206 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.536302 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.547061 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.556717 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.567489 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.577185 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.586850 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.597597 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.607279 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.616963 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.627729 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.637412 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.647100 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.657858 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.667554 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.677217 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.687963 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.697696 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.708413 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.718096 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.727777 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.738522 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.748239 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.757914 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.768689 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.778404 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.788105 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.798846 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.808512 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.818186 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.828928 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.838612 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.849337 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.858979 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.868661 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.879422 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.889120 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.898819 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.909587 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.919300 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.928982 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.939746 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.949453 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.959119 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.969875 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.979556 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.989207 E  decoding error End of file (-541478725)
2018-11-08 13:49:57.999951 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.009629 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.020370 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.030058 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.039763 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.050525 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.060183 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.069861 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.080613 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.090300 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.099984 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.110711 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.120408 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.131160 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.140838 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.150520 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.161249 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.170958 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.180655 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.191408 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.201103 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.210794 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.221537 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.231209 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.240901 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.251680 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.261410 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.271102 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.281858 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.291570 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.301237 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.311976 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.321656 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.332399 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.342097 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.351814 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.362627 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.372326 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.382033 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.392795 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.402456 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.412146 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.423063 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.432764 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.442470 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.453272 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.462951 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.472645 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.483395 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.493098 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.502807 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.513567 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.523246 E  decoding error End of file (-541478725)
2018-11-08 13:49:58.533106 I  CommDetect::GetCommBreakMap()
2018-11-08 13:49:58.533115 I  CommDetect::CleanupFrameInfo()
2018-11-08 13:49:58.533126 I  ClassicCommDetect: Only found 0 blank frames but wanted at least 1, rechecking data using higher threshold.
2018-11-08 13:49:58.533846 I  Minimum Average Brightness on a frame was -1, will use 2 as new threshold
2018-11-08 13:49:58.537960 I  Found 3051 blank frames using new value
2018-11-08 13:49:58.550410 I  CommDetect::GetLogoCommBreakMap()
2018-11-08 13:49:58.552208 I  Logo Commercial Break Map
2018-11-08 13:49:58.552219 I  Final Commercial Break Map
0
2018-11-08 13:49:59.595719 N  Finished, 0 break(s) found.

may You pls provide here Your log+settings from Your successful run on my sample? how it is possible that the same code+sample+settings gives different results...

comment:10 Changed 5 years ago by hamelg

Replay the same steps on the sample z.ts.

You get z.ts by removing the 1mn from sample8.ts with ffmpeg utility.

$ ffmpeg -i /var/http/sample8.ts -vcodec copy -acodec copy -ss 00:01:00 z.ts
$ mythcommflag --noprogress -v commflag:debug --override-settings-file /etc/mythcommflag-override2 --method 4  --skipdb --outputmethod full --outputfile /var/log/output.txt -f ./z.ts

comment:11 Changed 5 years ago by warpme

I see we are doing circles here...

Output from running commands like in Your comment #10 are the same like outputs I'm shown in comment#9

May You pls SEND HERE YOUR LOGS from running commands like in comment#10?

comment:13 Changed 5 years ago by warpme

Looking on Your logs: You are using v29 while I'm on master.

Sad You are not mentioned this in our all conversation here, so I'm wasting my time trying to understand where root issue is....

Its looks like master has regression in commflag as there is clearly difference between Your results and mine.

comment:14 Changed 5 years ago by hamelg

You don't waste your time, you will be happy when you'll enable the ad-breaks skip automatically :) The commflags settings require some times to get results.

The logo flag detection works in the branch master : to convince you, try it with my sample [1] [2].

I tested your sample z.ts with branch master. The different behavior comes from your sample.

  • In v29 : It correctly detects the frame rate.
  • In v30 : For unknown reason, the new libav detects a wrong frame rate at 50/s. With my sample the frame rate detected is ok. You can see that if you enable the libav logs (-v libav).

So, If you modify the setup according that (CommDetectLogoSamplesNeeded=15), It works with your sample [3].

[1] mysample https://app.box.com/s/yhq0yisbalnz37d8wcmh5corsno6e8r3
[2] logs in v30 with my sample https://app.box.com/s/ms1aapkm5ngymp6tb74ku6q14uobcvha
[3] logs in v30 with new settings on your sample z.ts https://app.box.com/s/hva8djfv18dvtesxgr1uhtjbe3s5q4in

comment:15 Changed 5 years ago by warpme

It still not works for me at current master.

Are You using official mythtv repo?

Here is what I'm receiving trying to build exactly Your version of mythcommflag (v30-Pre-832-g4e207477be-dirty from Your logs)

git checkout 4e207477be
error: pathspec '4e207477be' did not match any file(s) known to git.

eh....

comment:16 Changed 5 years ago by hamelg

I've just pushed 4e207477be in master. It should be ok now. But there is no modif, just merged gha-logo2 (the PR) and gha-debug.

comment:17 Changed 5 years ago by warpme

Well - lest synchronise terminology:

what you mentioned as "in mater" isn't master in terminology mythtv devs nor me nor mythtv users.

It should be called "my repo branch master". If You want to successfully include Your PR to myth code, it should:

1.pass some testing on _official_ myth code base

2.review with myth devs regarding myth coding standards+implementatoin correctnes (i.e. nor leading to regressions in other parts of code)

You are now in pahse1

While I understand that in development phase it might be easier to do thing initially on developer fork - but if development is engaging time of other persons - good collaboration requires proper communication.. . Since our last few exchanges I'm feeling constantly like person not informed correctly.

So I propose following:

1.You will demonstrate You PR code works ok on _official_ myth master. I'll be then co-work with You to move forward with Your code inclusion into master

2.You will choose not doing 1\ and then I'll stop guessing what You are doing

br

comment:18 Changed 5 years ago by hamelg

Ok, let's go back from zero.

Please, build from my repo, branch gha-logo2.

git clone https://github.com/hamelg/mythtv.git
git checkout gha-logo2

It contains just the PR and nothing else. You must get :

$ mythcommflag --version
Please attach all output as a file in bug reports.
MythTV Version : v30-Pre-830-g56f5b95202
MythTV Branch : gha-logo2
Network Protocol : 91
Library API : 30.20180319-1
QT Version : 5.11.2
Options compiled in:
 linux profile use_hidesyms using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xnvctrl_external using_libbluray_external using_xrandr using_xv using_profiletype using_systemd_notify using_systemd_journal using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_vaapi2 using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libmp3lame

Get the file sample.ts here : https://app.box.com/s/yhq0yisbalnz37d8wcmh5corsno6e8r3

Then run this test case.

$ cat mythcommflag-override 
CommDetectLogoSamplesNeeded=30
CommDetectLogoSampleSpacing=2
commDetectLogoLocation=NE
commDetectLogoWidthRatio=6
commDetectLogoHeightRatio=8
CommDetectLogoBorder=64
CommercialSkipMethod=4
$ mythcommflag --noprogress -v commflag:debug  --override-settings-file ./mythcommflag-override --method 4 --skipdb --outputmethod full --outputfile ./output.txt -f ./mysample.ts > mythcommflag.out 2>&1

I put output.txt and mythcommflag.out in attachments.

Changed 5 years ago by hamelg

Attachment: mythcommflag.out added

Changed 5 years ago by hamelg

Attachment: output.txt added

comment:19 Changed 2 years ago by Stuart Auchterlonie

Resolution: Trac EOL
Status: newclosed

We have moved all bug tracking to github [1]

If you continue to have this issue, please open a new issue at github, referencing this ticket.

[1] - https://github.com/MythTV/mythtv/issues

Note: See TracTickets for help on using tickets.