[mythtvnz] epgsnoop/xmltv-proc-nz/tv_grab_nz-py

Tony Sauri hoiho.nz at gmail.com
Mon Oct 13 22:15:27 BST 2014


On 14/10/14 00:31, Aaron Pelly wrote:
> xmltv grabber / mythfilldatabase advice:
> Will mythfilldatabase run automatically during a recording? Preliminary
> testing indicates that mhegepgsnoop trashes an in-progress recording,
> but that could be a coincidence. More testing is required.

Your message is really great news.

I have been sporadically kicking this issue around over the last couple
of years and have spent a bit of time working out how to ascertain and
predict physical tuner status so that an mheg grab will not impact
in-flight recording.

Unlike most other people I still use rb-download to grab the mmheg data
but I believe that some of the lessons I have learned should be usable
with other approaches.

I have used the mythtv services api to interrogate encoders, tuners and
upgoming recordings to establish the next 200 sec window where the 2
highest recpriority tuners are either busy or free.

I chose 200 secs because experimentation and experience has shown that
it only takes approx 50 secs to grab the whole mheg data carosel.

I prefer a busy tuner because than there is no overhead of tuning the
device before starting to grab the data.

Then I kick off the rb-download task but also spawn another thread to
monitor the downloaded data structures and flag the control task when
all directories and files have been populated.

Rb-download is a never ending program so has to be killed when you have
enough data.

I have had various versions of this running for a couple of years now
via cron at 3:00am with NO intervention and after working out a couple
of subtle bugs have had no problem with it at all. Never had a trashed
recording.

Here is the  debug log data for a single run on 14 Sep this year.  I
have chosen this date as English premier league was being recorded at
3:00 am.

# ##################################################################
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 0 CARDID: 1
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 0 CARDID: 2
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 0 CARDID: 3
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 0 CARDID: 4
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 0 CARDID: 5
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 1 CARDID: 6
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 1 CARDID: 7
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 1 CARDID: 8
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 1 CARDID: 9
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 2 CARDID: 10
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 2 CARDID: 11
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 2 CARDID: 12
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 2 CARDID: 13
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 0 RECPRIORITY: 1
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 1 RECPRIORITY: 2
RUNTIME: 03:00:03 on 14/09/2014 VIDEODEVICE: 2 RECPRIORITY: 0
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1016 SERVICEID: 1502
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1036 SERVICEID: 1501
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1003 SERVICEID: 1300
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1004 SERVICEID: 1301
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1008 SERVICEID: 1302
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1009 SERVICEID: 1303
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1018 SERVICEID: 1304
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1001 SERVICEID: 1200
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1002 SERVICEID: 1201
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1006 SERVICEID: 1206
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1007 SERVICEID: 1207
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1005 SERVICEID: 1400
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1022 SERVICEID: 1401
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1028 SERVICEID: 1403
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1010 SERVICEID: 1404
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1033 SERVICEID: 1405
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1012 SERVICEID: 1407
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1030 SERVICEID: 1408
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1024 SERVICEID: 1409
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1031 SERVICEID: 1410
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1032 SERVICEID: 1411
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1035 SERVICEID: 1412
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1026 SERVICEID: 1414
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1014 SERVICEID: 1415
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1040 SERVICEID: 1416
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1039 SERVICEID: 1417
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1023 SERVICEID: 1418
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1034 SERVICEID: 1421
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1021 SERVICEID: 1503
RUNTIME: 03:00:03 on 14/09/2014 CHANID: 1020 SERVICEID: 1504
RUNTIME: 03:00:03 on 14/09/2014 SLEEPTIME 3772
 ADAPTER0: Free: 0, 52192,	<<<<< Free for 52192 secs
 ADAPTER1: Busy: 1, 3772, 1200,	<<<<< Busy for 3772 secs
 ADAPTER2: Free: 0, 59212

RUNTIME: 03:00:03 on 14/09/2014 SERVICEID FOR CAPTURE: 1200
RUNTIME: 03:00:03 on 14/09/2014 COMMAND: /usr/local/bin/rb-download -a 1
-b /tmp/mheg_snoop_epg_data -f /home/tartarus/data/channels.conf 1200 >
/dev/null 2>&1
RUNTIME: 03:00:03 on 14/09/2014 DURATION:51 secs. ADAPTER:1 SERVICEID:
1200 DATATILL: 20140921


# ##################################################################

I could cut the cord to Hads EPG but have not mainly because I do not
want to lose the benefits of Hads optimisations.

So I have just been keeping my code in the bottom drawer against a
possible future copyright bloodhounds interference again.

If you want to explore the use of any of this let me know.

Regards

Tony


Afterthought:  Hads original idea to Crowd-Source the coding of
categories etc was inventive and I participated for a while but soon
found that different people categorise things differently (eg One
persons drama is another persons soap) and people were stomping over
each other so it became impossible to set up the schedule your way and
keep it that way.





More information about the mythtvnz mailing list