On Sat, 6 Oct 2007, Adam Charrett wrote:

> I'm currently working on live pause for DVB using a similar method to
> access the signal (DVBStreamer application for stream over a network),
> it shouldn't be too difficult to add control of the HDHomeRun into this.
> I'm in the process of rewriting the existing live pause plugin so that
> it is more stable and possible to have larger pause buffers. This should
> take a couple of weeks. If you could find out some information on the
> protocol used by the HDHomeRun I'll see about incorporating it.

Probably the easiest (best?) way is to wrap the command line application 
in a python class and use that to control the tuner(s).  As for streaming,
it's really simple:

--- python example ---

import socket, sys, time

seconds=60*60           # time
filename = 'test.avi'   # filename
host='192.168.1.1'      # destination host
port=1234               # any udp port
tuner=0                 # 0 or 1
id=0xffffffff           # broadcast id, can be a hex id of indiviual hdhomerun

s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('',port))
os.system('hdhomerun_config %x set /tuner%d/channel %s' % (id, tuner, '8vsb:4'))
os.system('hdhomerun_config %x set /tuner%d/program %s' % (id, tuner, '1'))
os.system('hdhomerun_config %x set /tuner%d/target %s:%d' % (id, 
tuner,host,port))

start = time.time()
outfile = open(filename, 'wb')

while time.time() - start < seconds:
   data,addr = s.recvfrom(64<<10)
   outfile.write(data)

os.system('hdhomerun_config %x set /tuner%d/target none' % (id, tuner))
s.close()

--- python example ---

Simple?  It has 2 tuners, so support would have to allow that.  Plus,
you can have many hdhomerun boxes as network bandwidth will allow.
The command-line application comes with the source so the actual protocol
can be determined.  I was thinking of creating a python module as a
direct interface to the hdhomerun units.  If it would help, I can post
it.

Currently, I'm trying to set VCR_CMD to a custom script I'm writing to
record the shows.  I'm having problems getting the tuner channels from
the TV_CHANNELS variable in /etc/freevo/local_conf.py.  Because the
schedules direct channels (using xmltv) do not have the program encoded
in them so I cannot get channels like 6.1, 6.2, etc.  I looked at 
freevo/tv/generic_record.py and it seems that the %(channel) that gets
formatted in VCR_CMD is using a variable tunerid.  It's not using the
correct (in my understanding) tuner id.  My TV_CHANNELS, and VCR_CMD
is setup as:

TV_CHANNELS = [
   ('4 KVOADT',         'KVOADT',       '8vsb 4.1'),
   ('6 KUATDT',         'KUATDT',       '8vsb 6.1'),
   ('6 KUATDT2',                'KUATDT2',      '8vsb 6.1'),
   ('6 KUATDT3',                'KUATDT3',      '8vsb 6.1'),
   ('11 KUATDT4',       'KUATDT4',      '8vsb 11.1'),
   ('18 KTTUDT',                'KTTUDT',       '8vsb 18.1'),
   ('27 KUASDT',                'KUASDT',       '8vsb 27.1'),
   ('46 KUASDT',                'KUASDT',       '8vsb 46.1'),
   ('58 KWBADT',                'KWBADT',       '8vsb 58.1'),
   ('58 KWBADT2',       'KWBADT2',      '8vsb 58.2'),
]

VCR_CMD = ('/u/tv/bin/tvrec ' +
         'channel=%(channel)s ' +
         'length=%(seconds)s ' +
         'filename=%(filename)s')

I created a test script:

#!/bin/sh
echo "$*" >>~/.tvrec/log

And when I record a show and get this:

channel=4 length=3590 filename=/media/tv/10-05_19_00_Deal_or_No_Deal.avi

I thought it should be 'channel=8vsb 4.1'.

Any ideas to what I'm doing wrong?

Matt

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to