[detectads] Automatically bookmark ad breaks

njm

Member
Detectads is a Custom Firmware package for bookmarking ad breaks so they can be skipped during playback using the bookmark button on your remote.

Adverts start and end with short silences; clusters of these short silences indicate an ad break, which Detectads delimits with bookmarks. The idea (and most of the code) came from the MythTV wiki.

Detectads can process individual recordings through the web interface or it can process a recording automatically after it has been decrypted. Automatic processing is disabled by default for now, but it can be enabled in the settings section of the web interface.

from_webif.png

auto.png

Detection isn't 100% accurate and it never will be, but it is correct most of the time.

bookmarks.png

Known issues:
- recordings that are moved by sweeper will not be processed automatically

Thanks to af123 for the web interface and for publishing the package to the main repository.
 
Great work. I'm away on vacation at present but looking forward to getting home and trying this and CF. V3.0.
 
Worked perfectly on How I Met Your Mother last night (E4).

I notice that automatic detect ads processing is now decoupled such that it will resume if interrupted by a power off!
 
Thanks for this.

One observation. Does it look at the recorded channel and only try and work automatically on those that are likely to have ads (i.e. non BBC)? It seems quite happy to try and process a BBC4 recording if I set it off manually, which should obviously find nothing, but it might be a waste of cpu cycles if it tries to automatically process all recordings regardless of channel.
 
I tried a couple of manual runs last night but it did not it get as far as suggesting bookmarks. I was running off a tablet (Android) and was wondering if it could be an issue with the data from the analysis not being uploaded back to the browser? I tried Dolphin and Firefox, but the outcome was the same. In each case, I eventually got a dialogue box back from Web-If to dismiss but there was nothing to indicate success or failure: something like '192.168.0.6 says' with an OK button. I'll try autoprocessing and see what happens.
How long does the analysis typically take? From the original thread it seemed like high definition programmes needed different parameters from standard. Is this handled automatically?

Edit. It worked fine with chrome for android, so it must have been a problem with the other browsers.
 
Does it look at the recorded channel and only try and work automatically on those that are likely to have ads (i.e. non BBC)?

Removing that block of adverts at the beginning and end of BBC programs would be useful: the ones for other BBC programs. They can last several minutes.
 
My BBC recordings always start on the mark - never any prior 'adverts' (using AR, not padding).

Personally I'm not really bothered what happens after the end of a programme, as I delete the majority of them anyway.
 
@MontysEvilTwin, for HD it takes about 0.5x the length of the recording; for SD it takes about 0.25x the length of the recording. No special configuration is required for HD programmes - it's all handled automatically.

@rpb424, right now it treats recordings from BBC channels the same as any other. I want to change this at some point. For BBC channels it could just analyse the start and end of the programme to save some time.
 
This is a superb package: @njm - thanks for sharing it. I was doing a manual process of a film (Nexus 7/ Chrome browser) and had the same problem as before, i.e. the analysis did not complete, and no bookmarks were appended. I think the problem is due to the tablet going to sleep. The progress of the analysis is fed back to the browser and it seems that if the link to the browser fails the process stops. I can probably get round this by changing the sleep settings on the tablet, but for a future version, would it be possible to enable the process to complete even if the connection to the browser is broken?
A nice feature to have in a future version would be a Web-If flag, so that individual folders can be flagged for auto-detection. This way, selected programmes could be placed in a particular folder and processed automatically.
 
would it be possible to enable the process to complete even if the connection to the browser is broken?
+1. I think that means putting a "&" at the end of a line in the script.

A nice feature to have in a future version would be a Web-If flag, so that individual folders can be flagged for auto-detection. This way, selected programmes could be placed in a particular folder and processed automatically.
I'm sure a WebIF auto-process version is on the agenda!
 
@MontysEvilTwin, the process should run to completion even if the browser is closed (at least, that's what happened when I tried it).

I just tried kicking off a detection from the web interface while monitoring the running processes on the HDR with top over telnet. The necessary processes (ffmpeg, silence, and jimsh) were all still running after I closed the browser window. Once those processes were no longer showing up in top (because the process had finished) I could see that the bookmarks had been set. Have you tried running the same recording from a desktop machine? Perhaps it just failed to find the adverts?

I like the individual folder flag idea. I need to think about how automatic processing should work. Right now automatic processing will automatically detect adverts in a recording once it has been decrypted by auto-decrypt. This works well most of the time, but if sweeper moves the recording after it has been decrypted then it won't get processed. I use sweeper to move all my films into a folder, so right now none of my films get processed automatically.
 
@njm. I've not tried it using a desktop, just an Android tablet. It works fine with Chrome as long as you don't allow the tablet to sleep. If it does sleep during the process, when I wake the tablet up and restore the browser, I get a message (dependent on the IP address of the unit): '192.168.0.6 says' with an 'OK'. To date I have clicked on 'OK' and the process has stopped. I wonder if it carries on if the 'OK' is not pressed? I'll try it and see. There are possible workarounds, like increasing the time until the tablet sleeps while a run is ongoing, or the method suggested by Mike0001.
I think the manual and auto options are fine. For me, I do not want to process everything so the flagging option would be great. I don't know the technical ins and out, but most auto processes are flag based, with normal and recursive flag options. So, for example, if you flag a single folder for autodecrypt, that folder is processed. If you flag 'My Video' for recursive autodecrypt all files in that folder and in all sub-folders are processed: folders with names enclosed in square brackets are ignored. Apologies if you already know this stuff: you are clearly an experienced programmer, but I don't know how much you have used Web-If. If you do need more info, I'm sure that there are people on this forum who will provide assistance.
 
@MontysEvilTwin, I've had a bit of a play around and I can reproduce the problem you had. I'll have a think about alternative ways of running this from the web-if.
 
Back
Top