[mythtv-users] PVR-150/300/500 HVR-1600 commflag workaround
faginbagin
mythtv at hbuus.com
Mon Nov 10 05:14:01 UTC 2014
On 11/9/2014 2:19 PM, Hika van den Hoven wrote:
<snip>
>>> To explicate, on recording it looks like I get a speed shifted
>>> seektable, which shows on both jumping on playback and on the
>>> commercial detection.
>>> That brings me to a practical question. I tried encapsulating
>>> commercial detection in a script, where I first rebuild before
>>> detecting. It however is unclear to me, what is by default passed on.
>>> I tried:
>>> #!/bin/bash
>>> declare FileName=${1:-""}
>>> [ "$FileName" == "" ] && exit 0
>>> /usr/bin/mythcommflag --rebuild -f $FileName
>>> /usr/bin/mythcommflag $@
>>> exit $?
>>> Which does the rebuild, but no commercisl detection?
>
>> I assume you're passing only one argument to the script, the
>> filename? Or, the filename is at least the first argument? It should
>> be the full path name, not the basename. And you need to insert a -f
>> in-between mythcommflag and $@. If mythcommflag doesn't like the
>> arguments you give it, it will print a usage message and exit with a non-zero exit code.
>
> I thing you there got my error. If you leave it to default or set it
> to just mythcommflag the switches are automatically added and I
> couldn't find what is automatically added. If I remember correctly I
> either just put the scriptname there or added the %FILE%. I'll insert
> the -f
Ah, I think I understand. This is a script you want to use in the JobQueueCommFlagCommand database setting, which can be specified in mythtv-setup, General -> Job Queue (Global) page, "Commercial-detection command" right?
I just looked at the code, and if the value of that setting is "mythcommflag" or the null string, then the right parameters get added automagically. But if the value is something else, then you need to add the parameters your script expects to the setting. So I think the script will work if you've got a JobQueueCommFlagCommand value like "my-script-name %FILE%" and you insert the -f as I suggested. When your script is executed by the backend, %FILE% will be replaced with the basename of the recording file.
You might need to enable the "Run jobs only on original recording backend" and disable "Start auto-commercial-detection jobs when the recording starts" settings on the same mythtv-setup page in order for the script to work properly.
I also found out I was wrong about mythcommflag needing the full path name, the basename will work.
Regards,
Helen
More information about the mythtv-users
mailing list