[mythtv-users] Delayed User Job

Rod Smith mythtv at rodsbooks.com
Fri Mar 2 15:56:55 UTC 2007


On Friday 02 March 2007 05:11, Andrew Wilkinson wrote:
> Hi,
>
> I'd like to run a transcoding job on all recording, once they're a week
> old. If I watch something soon after it's been recorded then I'd like to
> keep it at maximum quality, if I haven't watched it for a week I would
> rather save disk space at the expense of some picture quality.
>
> I know I can automatically transcode things as soon as they're recorded,
> but what about after a week?
>
> I don't mind having a script that runs when I switch my computer on each
> morning, but I'm not sure how to get the list of recordings and then
> trigger a transcode on them.

I've never attempted this, so I can only suggest what to do as a vague 
outline:

1) Create a script, to be run as a MythTV user job, that adds the filename
   of a recording and a date/time stamp to a file in some convenient
   location.

2) Create another script, to be run as a cron job, that examines the
   above-created file and does two things:
   a) Deletes entries for files that have already been deleted
   b) Transcodes files that are older than a target date and deletes the
      matching entries

3) Set up a cron job to run the script created in #2. Once a day would
   probably be sufficient, but doing it more often would help spread the
   transcoding load around in time, if that were desirable.

4) Configure MythTV to run script #1 as a user job for all the shows
   that you want to get this treatment.

Unless I'm missing something, the above should do the trick. Of course, stated 
in this broad a fashion it sounds pretty easy (assuming you know a suitable 
scripting language), but managing that queue of shows (in steps #1 and #2) is 
likely to be a pain if you attempt to do it "from scratch." There are 
probably existing tools that would help manage the queue, but I don't know 
offhand what they might be.

-- 
Rod Smith
http://www.rodsbooks.com


More information about the mythtv-users mailing list