[mythtv-users] Scheduling priorities based on subtitles/widescreen/stereo/etc?

Bruce Markey bjm at lvcm.com
Sat Dec 10 15:08:08 EST 2005

Kim Wall wrote:
> I was just helping a mythtv-using friend fiddle around with channel 
> priorities in order to avoid recording from a DVB mux with 
> intermittently flaky reception (they live in a rented house, and the 
> aerial could be better).  This seems to have solved their problem 
> nicely, but it got me thinking...
> As my partner is deaf, I want to record programmes with subtitles if at 
> all possible.  For reasons that probably make sense to the 
> broadcasters[1], here in the UK programmes are sometimes shown several 
> times, but only some showings have subs (For example, HIGNFY[2] is shown 
> on a Friday within hours of being recorded, and repeated the following 
> day with subtitles added.  Numb3rs is shown on ITV3 without subs, but is 
> repeated on ITV1 with subtitles.)
> It occurred to me that, given listings data that accurately reflects the 
> availability of subtitles, the scheduler could use this as a factor when 
> deciding which programmes to record, in much the same way that it can 
> prioritise channels or tuners.  I don't think myth includes this 
> functionality already?

Um, I'll say 'sort of' to put a positive spin on it.

> Of course, this need not be limited to subtitles/captions.  It could be 
> equally useful for preferring or avoiding stereo, widescreen, audio 
> description, commercials, hdtv, additional language tracks, in-vision 
> signing, scifi that's been cut to shreds to be shown in 'children's' 
> slots, etc.  Basically any of these programme features that can be 

I can see how this could be done but it won't be in 0.19.

> derived from the listings data and stored in the database (I've looked, 
> and it appears to have fields for subtitles, captions, stereo and hdtv - 
> though tv_grab_uk_rt doesn't appear to be populating them, I assume this 
> works with other countries' providers.).

This could be a problem. To make best use of this information,
the grabber should break this out into a separate field and
mythfilldatabase should set the flags in the appropriate fields
of the mythconverg.program (one "m" and no "e" ;-) field. Myth
currently has flag fields for previouslyshown, stereo, subtitled,
hdtv, closecaptioned, generic. You want the grabber and mfdb
to set closecaptioned = 1 for listings that indicate that this
is true.

One thing you could do now is to create Custom Record rules for
favorites http://www.mythtv.org/docs/mythtv-HOWTO-12.html#ss12.5

Rule Name: Numb3rs
program.title = 'Numb3rs'
AND program.closecaptioned = 1

This works for me with DataDirect in the US but I just have one
current showing which is flagged for CC. This would only match
showings with captions. If you wanted to fail over to showings
without captions if necessary, add a regular rule for Numb3rs
with the priority lower by 1. Obviously this would be painstaking
for every show but may be worthwhile for a few favorites where
you know there is a mix of some with and without captions.

However, you say that the tv_grab_uk_rt doesn't appear to be
populating these. Until that can be fixed, you can do the same
sort of thing with however it is marked. As a guess, maybe it
has "CC" in the description? If so, you can try to match "CC"
but matching is case sensitive by default and we don't want to
match "access" so this should force a case sensitive match:

Rule Name: Numb3rs
program.title = 'Numb3rs'
AND program.description  COLLATE latin1_bin LIKE '%CC%'

> Any thoughts?

Back to your suggestion of using these flags in the priority
calculations, I can see adding a page to TV-Settings->Recording
Priorities->Set Recording Priorities. Like the settings per
record type, have settings for modifying the priority per flag
in the listings.

For now, here is a patch that will add 1 to the total priority
when closecaptioned is 1 (pretty simple, hey? ;-) This will make
showings with CC one better than showings without and this will be
true for all listings.

But you still need to set the flag. I have some "ACC" basketball
games (sort of like football but with much higher scores ;-)

mysql> select title,description, closecaptioned from program where program.description  COLLATE latin1_bin LIKE '%CC%'\G
*************************** 1. row ***************************
         title: ACC Basketball Season Preview '05: Men's Special
   description: Previewing the 2005-06 ACC men's basketball season.
closecaptioned: 0

This will set the CC flag:

mysql> UPDATE program SET closecaptioned = 1 WHERE program.description COLLATE latin1_bin LIKE '%CC%';
Query OK, 2 rows affected (0.18 sec)
Rows matched: 2  Changed: 2  Warnings: 0

         title: ACC Basketball Season Preview '05: Men's Special
   description: Previewing the 2005-06 ACC men's basketball season.
closecaptioned: 1

Attached is a script that will do this for you. Again this assumes
that "CC" appears in the description. If that's not the case you'll
have to modify it.

Hope this helps,

--  bjm
-------------- next part --------------
Index: programs/mythbackend/scheduler.cpp
--- programs/mythbackend/scheduler.cpp	(revision 8226)
+++ programs/mythbackend/scheduler.cpp	(working copy)
@@ -1962,7 +1962,7 @@
 "program.airdate, program.stars, program.originalairdate, RECTABLE.inactive, "
 "RECTABLE.parentid, ") + progfindid + ", RECTABLE.playgroup, "
 "oldrecstatus.recstatus, oldrecstatus.reactivate, " 
-"channel.recpriority + cardinput.preference "
+"channel.recpriority + cardinput.preference + program.closecaptioned "
 + QString(
 "FROM recordmatch "
-------------- next part --------------
# setcc: update the mythtv listings to set the "closecaptioned" field
#        if "CC" is found in the description

mysql -u mythtv -pmythtv mythconverg << EOF
UPDATE program SET closecaptioned = 1
WHERE program.description COLLATE latin1_bin LIKE '%CC%';

More information about the mythtv-users mailing list