DetectAds

From hummy.tv Wiki
Revision as of 14:57, 27 July 2015 by MymsMan (talk | contribs) (DetectAds - Eliminate watching the commercial breaks!)
Jump to: navigation, search

DetectAds - Eliminate watching the commercial breaks!

Place Holder - Page under construction

Overview

Bookmark button arrowed

If you are fed up with watching all of commercials for this, that, and the other or you are a habitual user of the fast forward/skip buttons on the remote when an adbreak starts then DetectAds is the package for you!

DetectAds analyses recording to detect the commercial breaks and places bookmarks at the start and end of each break so that you can just use the Bookmark button (arrowed in picture) to jump instantly to the next bookmark. Alternatively you can leave the remote languishing between the sofa cushions and have DetectAds physically remove the commercials and EPG data from the recording shrinking the recording size considerably.

Automatic Processing

Traditionally automatic webif packages have been run sequentially on completed recordings under the control of the "auto" process which ran at fixed intervals. DetectAds can be run in this mode triggered from auto when auto-decryption completes.

Recent enhancements have improved the speed of this post-processing by triggering auto when a recording ends and allowing decryption to start before the system has DLNA indexed the recording but it still takes a significant time to sequentially run a number of processes on a recording.

DetectAds is an exceptionally slow process taking about 15 minutes to process an hour of SD recording which means that with the time to decrypt recording and perform crop there is a considerable delay before a fully processed recording is available for viewing.

DetectAds now introduces as an option a radically different processing model, with "Detect whilst recording" (also known as ChaseRun) the detection process runs in parallel with the actual recording so the processing completes within a few seconds of the recording finishing. You can even,with some limitations, start to watch your program adfree whilst it is still recording.

With both processing modes you can choose to exclude certain commercial free channels such as BBC and Radio stations from processing. (Ads on commercial radio stations are not recognized by DetectAds)

Invoking from Browse

To process a single recording you can select "Detect Adverts" from the Opt+ pull down menu on the webif Browse file list. This will lead you to the main panel where there are two processing options:

Run Analysis now
This processes the file immediately with the results displayed in the processing routine but due to the length of time taken to analyse a recording it is recommended that this option not be used unless you have a lot of spare time or need to investigate a problem!
Run Analysis in background
This option adds the recording to the detectads processing queue and returns. The queue is processed sequentially and, if the system is restarted, resumes on restart so if you have a number of recordings to be processed they can be safely added to the queue without waiting for preceding files to finish processing.

If the file has already been decrypted the program will be processed in 'traditional' mode otherwise it will be processed in the new 'chaserun' mode.

DetectadsBrowseIndex.jpg

DetectadsBrowseMain.jpg DetectadsBrowseRunning.jpg

Command Line

Detectads can also be started from a Telnet command line or from another script which could be useful if you have a batch of existing recordings to be completed.

detectads = Detect ads in recordings and bookmark or crop them

detectads -d parameters = produce debug on Stdout
detectads -h            = produce this help
detectads -pq           = process queued requests
detectads -aq recording = add recording to request queue
detectads -pr recording = process recording now

Note: It is not possible to specify all DetectAds options via the command line, use the Settings page to set processing options.

If the file has already been decrypted the program will be processed in 'traditional' mode otherwise it will be processed in the new 'chaserun' mode.

Settings

Settings page

Options specified via the webif Settings section for DetectAds are

Automatically process recordings whilst recording in progress?
Select the new 'chaserun' processing mode, faster but not yet widely tested
Automatically process recordings following auto-decryption?
Select the slower 'traditional' automatic processing following decryption
Exclude channels from automatic processing
Exclude BBC and other non commercial channels from processing, see below for more details
Crop recording following ad detection?
Automatically run nicesplice to delete the adbreaks and shrink the recording file
Dustbin/delete original recording after processing?
Select No if you don't trust the detection/cropping process 100% and want to keep the original around without hunting in the dustbin to find it.
Write output recording to
Choose target for writing output recording, 'Other' can only be a fixed path - if you want to vary the path use the 'Sweeper' package instead

Channel exclusion list

Channel exclusion page

Channel exclusion is modelled closely (plagiarised) on the ChannelDel package. You can type a generic matching rule such as 'BBC *' in the left hand or ctl-click on specific channels and then click the &larrow; button to transfer them to the left column. To remove entries from the left column position the cursor and use delete or backspace keys.

If you record from CBeebies, CBBC, commercial radio stations I suggest you add them to the exclusion list since they are not covered by the default configuration.

Chase playing

You can watch the output from the ChaseRun process whilst recording is still in progress either through the normal TV user interface or via file sharing using an application such as VLC however there are a number of things to be born in mind.

  • You can't remotely access the file via DLNA, only via file file sharing, there are two reasons for this.
    • The output files have not been indexed by the DLNA server and
    • the DLNA server only returns the amount of program known at the start of the request and so wouldn't return the entire program
  • If you use the skip/fast forward buttons you are liable to run past the end as known by the Humax and playback will terminate prematurely
  • If watching the -crop cropped output you have to take into account the total amount of advert breaks to be removed and the lag in producing cropped output. e.g. if you starting watching a program with 15 minutes of ads 10 minutes after it starts you will inevitably catch up with what has been processed before the end of program and playback will end. It would be safer to wait 30 minutes before attempting to start Chase play.
  • If watching the -dec decrypted output you will only see the bookmarks that have already been detected since the Humax only reads the hmt file at program start, you could also inhibit the DetectAds process' ability to clean up at the end of recording which may leave orphan symlink files hanging around for the nts file.

In general you will get the best Chase play experience viewing the -crop output on TV, starting half way or later through the recording time and leaving the remote control alone once play has started!

Debugging

DetectAds writes a few lines to the recmon.log or auto.log depending on operating mode but the vast majority of output is written to /mod/tmp/detectads.log and can be viewed by the log viewer on the webif Diagnostics page. The amount of log data written is controlled by the "Auto-processing log level" setting in General Settings on the webif Settings page or specifying the -d option when using the command line interface. If you experience a power cut or other failure during Chaserun processing there is no automatic restart processing and you may be left with orphaned symlink files which could cause the system to go into "delinquent half-awake state" where it never properly goes into full standby mode. If you suspect that this is occurring use Telnet to explore the /media/My Video folder and subfolders with ls -l to look for stray symlinks which will look something like

 
lrwxrwxrwx  1 root root         55 Jul 27 14:14 Countdown_20150727_1409-dec.nts -> /mnt/hd2/My Video/Countdown/Countdown_20150727_1409.nts

these can be removed with commands like

rm "Countdown_20150727_1409-dec.nts"

the quotes around file names are need when there are spaces in the name.

Under the covers

Change History

Future Enhancements

Acknowledgements