[mythtv-users] Commercial detection with silence - silence.cpp

Mark Perkins perkins1724 at hotmail.com
Fri Aug 9 00:33:01 UTC 2013


With reference to the Commercial detection with silence for UK freeviewHD
wiki page at
http://www.mythtv.org/wiki/Commercial_detection_with_silence_for_UK_freeview
HD

 

I'm new to MythTV so sorry if this is a dumb question or has been covered
elsewhere.

 

I managed to get the scripts to compile and install with no problems however
was not able to get the silence detection to work correctly. It either
detected no silences, or every frame as silent depending on the threshold db
set with only a very small decimal change required to move from no silences
to all silences. There was nothing in between, it was all or nothing.

 

Long story short, after much troubleshooting I found that I was having
problems with the comparison between the set threshold and the avgabs
variable declared in the silence.cpp code.

 

I found that if I replaced line 373 of silence.cpp:

 

        // determine average audio level in this frame

        long avgabs = 0;

 

with:

 

        // determine average audio level in this frame

        float avgabs = 0;

 

that the threshold comparison would work correctly and silences were
detected correctly. In fact it works very well for me now.

 

But I am confused as to why this was causing a problem for me and not for
others? Have I missed something else?

 

Any assistance or comments appreciated.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20130809/faa3cff5/attachment.html>


More information about the mythtv-users mailing list