<br><br><div class="gmail_quote">On 9 March 2012 13:44, Anthony Giggins <span dir="ltr">&lt;<a href="mailto:seven@seven.dorksville.net">seven@seven.dorksville.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div class="im">On 8 March 2012 20:47, Lawrence Rust <span dir="ltr">&lt;<a href="mailto:lvr@softsystem.co.uk" target="_blank">lvr@softsystem.co.uk</a>&gt;</span> wrote:<br></div><div><div class="h5">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Wed, 2012-03-07 at 23:13 +0000, Thomas Boehm wrote:<br>
&gt; Martin Moores wrote:<br>
&gt; &gt; On 7 March 2012 21:58, Doug Lytle &lt;<a href="mailto:support@drdos.info" target="_blank">support@drdos.info</a><br>
&gt; &gt; &lt;mailto:<a href="mailto:support@drdos.info" target="_blank">support@drdos.info</a>&gt;&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;     And I believe there was an external script based on volume changes on a<br>
&gt; &gt;     channel that people have reported good results with.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Indeed, I never got around to trying that, but many said they had a lot<br>
&gt; &gt; of success with it:<br>
&gt;<br>
&gt; It works very well for me. I changed the script so that it runs on all<br>
&gt; channels, not only the white listed ones. If there is really a show<br>
&gt; which doesn&#39;t get marked properly, I still press the forward button a<br>
&gt; few times as I did before, but most of the times it works.<br>
&gt;<br>
&gt; The mythcommflag which comes with MythTV takes much longer and basically<br>
&gt; doesn&#39;t work at all in the UK.<br>
<br>
</div>I use a script based on the wiki article<br>
<a href="http://www.mythtv.org/wiki/Mythcommflag-wrapper" target="_blank">www.mythtv.org/wiki/Mythcommflag-wrapper</a> with good success on most UK<br>
Freesat channels.<br>
<br>
I found that changing the silence threshold to -76 dB from -70<br>
significantly improved accuracy.  Also, decreasing the coalescence time<br>
from 400 to 360 seconds reduced the prevalence of false positives.  The<br>
last useful tweak is to the awk program to add &#39;cut to beginning&#39; or<br>
&#39;cut to end&#39; without leaving &#39;dangling&#39; frames.<br>
<br>
This generally leaves a few frames of ads/titles before and after each<br>
cut.  The only annoyance is that the post ad cut doesn&#39;t position to a<br>
keyframe so the cut isn&#39;t entirely invisible.  I&#39;m working on that and<br>
back tracking from the start of cut to detect a scene change.<br>
<br>
The script can be found here:<br>
<a href="http://www.softsystem.co.uk/download/mythtv/mythcommflag-silence.sh" target="_blank">http://www.softsystem.co.uk/download/mythtv/mythcommflag-silence.sh</a><br>
<br>
To run it as a user job, start mythtv-setup and find General/JobQueue<br>
(Global) and set the Ad-detection command:<br>
mythcommflag-silence.sh -j %JOBID% -C<br>
<br>
The -C option copies the list to the cutlist.<br>
<span><font color="#888888"><br>
--</font></span><br></blockquote></div></div><div><br>I get an error in this script when running from a command prompt<br><br>./mythcommflag-silence.sh -c 4010 -s &quot;2011-09-29 21:10:00&quot; -i /storage3/recordings/4010_20110929211000.mpg<br>

mythcommflag-silence.sh: line 11: syntax error near unexpected token `cat&#39;<br> <br>I assume the syntax here is not correct?<br><br>Help() cat &gt;&amp;2 &lt;&lt;END<br>Detect commercial breaks in a TV recording using silence detection.<br>

Usage: ${myname##*/} [options]<br>Options:<br>  -b &lt;n&gt;    Coalesce ad breaks upto [$MAXCOMMBREAKSECS] Seconds<br>  -c &lt;n&gt;    Channel ID<br>  -d &lt;f&gt;    Min silence duration [$SILENCE_DURATION] Seconds<br>

  -i &lt;path&gt; Recording filename<br>  -j &lt;n&gt;    Job ID<br>  -s &lt;s&gt;    Start-time<br>  -t &lt;n&gt;    Silence threshold [$SILENCE_THRESHOLD] dB (-96..0)<br>  -C        Copy to cutlist [$COPYTOCUTLIST]<br>
  -M &lt;path&gt; MythTV settings folder [$MYTHCONFDIR]<br>
  -h        Display this help and exit<br>  -V        Display version and exit<br><br>A job ID, channel ID and start-time or a recording filename must be specified.<br>END<br><br><br>Cheers,<br><br>Anthony<br></div></div>

</blockquote></div><br>Opps also tried<br><br> ./mythcommflag-silence.sh -j 10087 -c 4010 -s 2011-09-29 21:10:00<br><br>but getting the same error<br>