[mythtv-users] Help needed for scripted recordings

Klaas de Waal klaas.de.waal at gmail.com
Sat Mar 28 15:43:47 UTC 2020


On Sat, 28 Mar 2020 at 14:26, Bill Meek <keemllib at gmail.com> wrote:

> On 3/27/20 8:41 PM, David Engel wrote:
> > On Fri, Mar 27, 2020 at 06:58:16PM -0500, Bill Meek wrote:
> >> On 3/27/20 12:13 PM, Klaas de Waal wrote:
> >>> Hi all,
> >>>
> >>> I am attempting to fix bug #13571 and to test this I need to start and
> then
> >>> delete recordings lots and lots of times. It would be great if I can
> start
> >>> a script that starts a recording on a specified channel, wait 10
> seconds,
> >>> delete the recording, wait 10 seconds, start a recording etc etc.
> >>> And I then want to run another instance of the script on another
> channel,
> >>> etc.
> >>> Has anyone a script available that does something like this, or a basic
> >>> example on how to build something?
> >>
> >> If the 10 second length, is a requirement, no need to read further.
> Otherwise,
> >> I might be able change the following to delete recordings
> automatically...
> >
> > Klaas can correct me if I'm wrong but I don't think 10 seconds is a
> > hard and fast requirement.  The problem at hand seems to occur when
> > deleting an in-progress recording but only occasionally.  I think the
> > 10 seconds is solely to recreate the in-progress, deletion condition
> > as frequently as possible in hopes of reproducing the problem more
> > quickly.
> >
> > David
>
> ...
>
> Klaas,
>
> New version, you can run it from a remote host (FE.) It uses the Services
> API
> Dvr/DeleteRecording:
>
>   vcr.py --chanid=1021 --delete_while_recording --dst --host=<backend
> hostname or IP> --length=1 --number=5 --starttime=2020-03-28T13:16 --wrmi
>
> will create 5 recording rules, 1 minute apart and 1 minute long.
> --starttime is
> in local time and gets converted to UTC for the API.
>
> 30 seconds (length/2) after --starttime the 1st recording and it's rule are
> deleted. Then every minute (length), the next recording and rule are
> deleted.
>
> The --dst switch is a kludge and subtracts 3600 seconds from --starttime.
> Works
> for North America.
>
>
> Hi all,

Thanks for the scripts. They do come close but I still miss a bit.

David, your description is spot on.
The crucial point is that I need to delete a recording in progress as often
as possible.
Reproducing the problem takes usually about 3 to 10 deletes before the
crash happens and this is still somewhat doable by hand.
However, to evaluate the effectiveness of various workarounds and maybe
even fixes I want at least 100 deletes to be successful.
Hence the need for automation.

Ideally I would have two commands:
- (A) start recording now on a channel, identified by chanid
- (B) delete the recording that is now being recorded on  channel,
identified by chanid
I can string this together with a trivial bit of bash and do the wait times
with sleep commands.
Something like "while [ 1 ] ; do command_A <chanid>; sleep 10; command_B
<chanid>; sleep 10; done".
If command A does return an ID that is to be used by command B then that is
OK as well of course.
A combined script would need 3 parameters, chanid, time_recording and
time_idle.
It looks like the mythtv-record.py comes close as it can do a "stop", it
only misses a "delete"command.
I'll have a look into the scripts myself as well but I do greatly
appreciate help with this as it is a bug that is difficult to catch.

Thanks,
Klaas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20200328/367f874a/attachment.htm>


More information about the mythtv-users mailing list