[mythtvnz] HDHomerun and EIT/EPG/MHEG

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Jul 27 02:14:02 BST 2012


On Thu, 26 Jul 2012 18:29:35 +1200, you wrote:

>Hi Guys,
>
>I have "just" joined the HDHomerun club and, like most, are now missing 
>program data. I have looked at a few options and I can't seem to get 
>"any" to work:
>
>tv_grab_nz-py:
>
[snip]
>So - I believe I have few options:
>
>1) Get tv_grab_nz-py to work
>2) Setup my hdhomerun as a dvb device and supply the xml to the public 
>as well - or some other method to get the program data OTA
>3) Find a source that has all the channels
>
>Did I miss something ?
>
>Cheers !
>
>Pieter

To get EPG for channels only available in your area, you will need to
run mhegepgsnoop and merge the data for those channels with the rest
of the downloaded EPG.  I was doing that for ChoiceTV until it turned
up in the nzepg.org download.  I run my EPG gathering in a script I
wrote for myself, and that script runs mythfilldatabase afterwards.
Then mythfilldatabase runs my modified version of tv_grab_nz.py which
gets its data from my web server where my script left the EPG data. My
mother's MythTV box also gets its EPG from that internal web server.

This is the script I used to run mhegepgsnoop and then split out the
ChoiceTV data:

#!/bin/bash

# DVB-T multiplex frequency (kHz)
DVB_T_FREQ=594000

# Adapter number of DVB-T card.
ADAPTER=2

# Output file to store the xmltv EPG data.
OUTPUT_FILE=/tmp/xmltv.xml

# Temp directory name.
TEMP_DIR=/tmp/mhegepgsnoop


PWD=`pwd`

if [ -e "$OUTPUT_FILE" ] && [ -f "$OUTPUT_FILE" ] ; then
    rm "$OUTPUT_FILE"
fi

# Get the MHEG5 EPG data from the DVT-T multiplex.
dvbtune -f $DVB_T_FREQ -qam 64 -gi 16 -cr 3_4 -bw 8 -tm 8 -m -c
$ADAPTER 2>&1 &
DVBTUNE_PID=$!
sleep 1
mhegepgsnoop.py -zp -d /dev/dvb/adapter${ADAPTER}/demux0 -o
$OUTPUT_FILE
kill $DVBTUNE_PID

# Extract the ChoiceTV channel data only.
mkdir $TEMP_DIR
cd $TEMP_DIR
tv_split -o %channel.xml.not $OUTPUT_FILE
mv choicetv.freeviewnz.tv.xml.not $OUTPUT_FILE
rm *.not

cd $PWD
rmdir $TEMP_DIR


The main EPG script called this script, then used tv_cat to merge the
mhegepgsnoop data with the downloaded data.  In your case, since you
need several channels, I would replace the "mv
choicetv.freeviewnz.tv.xml.not" line above with a tv_cat command to
merge the files for each of the channels you want, something like:

tv_cat --output $OUTPUT_FILE <channel_a>.xml.not <channel_b>.xml.not
<channel_c.xml.not>



More information about the mythtvnz mailing list