[mythtv-users] Automatic Commercial Detection - how to get it

Stephen Tait tait at digitallaw.co.uk
Wed Sep 22 20:51:38 EDT 2004

At 19:22 22/09/2004 +0100, you wrote:
>At 05:52 22/09/2004, you wrote:
>> > > What I have noticed however that every channel here in the UK pumps 
>> up the
>> > > volume considerably when switching to ads, which always has me reaching
>> > > for
>> > > the mute button. Is there any way commflag can be confugled to take this
>> > > into account also? Does the same kinda thing happen in the US?
>> >
>> > Absolutely does happen in U.S. Commercials are like people, they speak
>> > loudly to sound more intelligent.
>>I've yet to look at the audio data enough to know this or not, but I've heard
>>and read that it's not volume, it's something else that changes that makes
>>it seem louder.  I don't know.  I haven't even delved into trying to process
>>the audio to detect commercials, that's a whole 'nother beast.  Things like
>>audio silence during blank-frames and such would really help proper
>I'm not a coder by any stretch of the imagination, but if you like I'll 
>see if I can pull apart a few MPEG's and have a look at the waveforms and 
>suchlike and see if I can figure out what's going on.
>As I don't know how Myth works (i.e. how it would "see" the audio if and 
>when it scanned it - I'm imagining just as a regular waveform), if anyone 
>could proffer an idea for the best way for a patch that looked at the 
>audio would work, I'd be much obliged. Also, if there's any audio 
>manipulation done by either Myth's software encoding or by the ivtv-range 
>that anyone knows about I imagine it would prove very helpful. In the 
>meantime I'll check out some of the other links posted above.
>Bear in mind I've only got access to the UK's terrestrial channels, so if 
>there's any major differences between these and your NTSC streams I 
>imagine I'll be up shit creek ;)

Well, I've just pulled an episode of Cheers (UK channel 4, mid-morning 
housewife/ambulance chaser time) apart, and the sound signature is pretty 
easy to discern, even with the naked eye. The peak audio levels stay the 
same as the program, but the "base" audio never falls anywhere near the 0 
level, and tends to hover around about 70% of the peak. There are also gaps 
in the audio of about 1ms between each advert, where the level falls to 0 
(even the "quiet" bits in the program never fall to 0). If anyone is 
interested I'll put an image together along with a timeline. In the 
meantime I'll check it out with channels 3 and 5 and a few other TV progs 
and see if there are any other major differences. 

More information about the mythtv-users mailing list