From MythTV Official Wiki
Jump to: navigation, search


Experimental Commercial Flagging

To try the experimental commercial flagger, go to the "Setup : TV Settings : General : General (Jobs)" configuration screen, and select the "Experimental" commercial flagging method. The "Strict Commercial Detection" setting does not apply to the "Experimental" commercial flagger. I only have broadcast HDTV in the US, so I expect problems with:

  • analog recordings
  • premium cable channels (anything not available on broadcast TV)
  • non-US stuff (Europe, Asia, Australia, etc.)

To perform any kind of troubleshooting, run mythbackend and mythcommflag with "-v commflag", and update the following database settings:

INSERT INTO settings (value, data) VALUES ('TemplateFinderDebugLevel', '1');
INSERT INTO settings (value, data) VALUES ('TemplateMatcherDebugLevel', '1');
INSERT INTO settings (value, data) VALUES ('HistogramAnalyzerDebugLevel', '1');
INSERT INTO settings (value, data) VALUES ('BlankFrameDetectorDebugLevel', '1');

Debug levels of 2 or higher will generate more verbose logfile output. The TemplateFinder and TemplateMatcher debug levels can go up to 3 to generate a very large amount of output (~100MB, many JPEG frames for showing logo-detection analysis). The JPEG images are generated with convert, so imagemagick or graphicsmagick-imagemagick-compat will need to be installed on the system.

These debugging settings will result in the creation of "*-debug" directories in your MythTV recordings directory; they will not be automatically cleaned up when your recordings are deleted, so you will have to periodically clean them up yourself.

The "*-debug" directories contain data reflecting the results of the various analyses of mythcommflag. Subsequent runs of mythcommflag on the same recording will run much more quickly; mythcommflag will re-read these files, rather than re-process all of the video. The debugging output files are structured such that each line of output corresponds to the information for that frame number (line 1 represents the first frame, line 2 represents the second frame, etc.). In vi, one can do :set nu to turn on line numbers. The format of each file is rather simple; search for readData and writeData in the various *Analyzer.cpp source code files.

For subsequent graphical interpretation of the data, use the "mythcommflag-analyze" script to generate an index.html file with various graphs that can be conveniently viewed in a web browser:

sudo -H -u myth ./mythcommflag-analyze /media/myth/recordedtv/1021_20070124210000.nuv-debug