[mythtv-users] Commercial Flagging (UK, DVB-T)
D. R. Newman
d.r.newman at e-consultation.org
Sun Dec 16 22:23:23 UTC 2012
On 26/10/12 09:22, Tim Phipps wrote:
> My contribution to MythTV is here:
>
> http://www.mythtv.org/wiki/Commercial_detection_with_silence_for_UK_freeviewHD
>
>
> It's based on the one above but works on DVB-T2 as well, does not need
> to transcode the audio stream and can be run in realtime.
I tried this, it often works well, but it is not doing the same as
mythcommflag_wrapper, as it ignores the minimum time for silence.
Although min is passed as a parameter to mausc.c, it is never used.
mausc.c looks for silence in a single video frame, 1/25th of a second,
not all along 0.15 seconds (or whatever min has been set to). As soon as
there is a silent video frame, gapstart is set, so it reacts to 0.04
seconds of silence.
The result is that if there is a short silence in a programme, it is
treated as an advert break, instead of being ignored.
It is easy to drop short breaks, like this:
if (!silent && last_silent) {
if (frames < gapstart + min)
gapstart = 0
else
gapend = frames
}
but that only works on the first break (e.g. the start of an advert). We
also need code to check that the silence at the end of an ad break is > min.
Also, I wonder how we deal with recordings that start in the middle of
an advertisement, so the first silence is the end of a break? For those
of us who start recordings a few minutes before the scheduled time, that
is often the case.
David Newman
More information about the mythtv-users
mailing list