<br><br><div class="gmail_quote">On 9 March 2012 19:30, Lawrence Rust <span dir="ltr"><<a href="mailto:lvr@softsystem.co.uk">lvr@softsystem.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Fri, 2012-03-09 at 13:44 +1000, Anthony Giggins wrote:<br>
><br>
><br>
> On 8 March 2012 20:47, Lawrence Rust <<a href="mailto:lvr@softsystem.co.uk">lvr@softsystem.co.uk</a>> wrote:<br>
> On Wed, 2012-03-07 at 23:13 +0000, Thomas Boehm wrote:<br>
> > Martin Moores wrote:<br>
> > > On 7 March 2012 21:58, Doug Lytle <<a href="mailto:support@drdos.info">support@drdos.info</a><br>
> > > <mailto:<a href="mailto:support@drdos.info">support@drdos.info</a>>> wrote:<br>
> > ><br>
> > ><br>
> > > And I believe there was an external script based on<br>
> volume changes on a<br>
> > > channel that people have reported good results with.<br>
> > ><br>
> > ><br>
> > > Indeed, I never got around to trying that, but many said<br>
> they had a lot<br>
> > > of success with it:<br>
> ><br>
> > It works very well for me. I changed the script so that it<br>
> runs on all<br>
> > channels, not only the white listed ones. If there is really<br>
> a show<br>
> > which doesn't get marked properly, I still press the forward<br>
> button a<br>
> > few times as I did before, but most of the times it works.<br>
> ><br>
> > The mythcommflag which comes with MythTV takes much longer<br>
> and basically<br>
> > doesn't work at all in the UK.<br>
><br>
><br>
> 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<br>
> 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<br>
> coalescence time<br>
> from 400 to 360 seconds reduced the prevalence of false<br>
> positives. The<br>
> last useful tweak is to the awk program to add 'cut to<br>
> beginning' or<br>
> 'cut to end' without leaving 'dangling' frames.<br>
><br>
> This generally leaves a few frames of ads/titles before and<br>
> after each<br>
> cut. The only annoyance is that the post ad cut doesn't<br>
> position to a<br>
> keyframe so the cut isn't entirely invisible. I'm working on<br>
> 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<br>
> 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>
><br>
> --<br>
><br>
> I get an error in this script when running from a command prompt<br>
><br>
> ./mythcommflag-silence.sh -c 4010 -s "2011-09-29 21:10:00"<br>
> -i /storage3/recordings/4010_20110929211000.mpg<br>
> mythcommflag-silence.sh: line 11: syntax error near unexpected token<br>
> `cat'<br>
<br>
</div></div>This looks like a difference in sh implementations. From the sh man<br>
page 'man sh|grep -A 3 Function':<br>
<br>
Functions<br>
The syntax of a function definition is<br>
<br>
name () command<br>
<br>
See also the POSIX doc on shell functions:<br>
<a href="http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_05" target="_blank">http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_05</a><br>
<br>
As I understand it, a valid function can be:<br>
<br>
f1() echo "f1"<br>
<br>
Note the absence of { } around the command - these are for grouping and<br>
are theoretically optional although I am aware that bash requires them.<br>
The Help() function in mythcommflag-silence.sh doesn't include the<br>
braces and so is tickling this particular bug. For reference I'm<br>
running Ubuntu and sh is provided by dash, what distribution and sh are<br>
you running?<br>
<br>
Pragmatically I updated the script to include the braces which should<br>
fix this problem. Would you confirm that this change fixes the problem<br>
for you? Thanks for your feedback.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Lawrence<br>
<br></div></div></blockquote><div>I'm running mythdora 12.23 aka fedora 12<br><br>Was this right ?<br><br>Help() { cat >&2 <<END<br>Detect commercial breaks in a TV recording using silence detection.<br>
Usage: ${myname##*/} [options]<br>Options:<br> -b <n> Coalesce ad breaks upto [$MAXCOMMBREAKSECS] Seconds<br> -c <n> Channel ID<br> -d <f> Min silence duration [$SILENCE_DURATION] Seconds<br>
-i <path> Recording filename<br> -j <n> Job ID<br> -s <s> Start-time<br> -t <n> Silence threshold [$SILENCE_THRESHOLD] dB (-96..0)<br> -C Copy to cutlist [$COPYTOCUTLIST]<br> -M <path> 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><br>I tried running with with dash but it doesn't seem to do anything<br>
<br>$ dash ./mythcommflag-silence.sh -i /storage3/recordings/4010_20110929211000.mpg<br>$<br><br></div></div>Cheers,<br><br>Anthony<br>