Freevo

- User Documentation

# Analoguefreq

## Use frequencies in mencoder instead of channels

The channel list is a convention on which frequencies are allowed to be broadcasted in some countries. Cable operators need more channels and have the possibility to use frequencies which are not allowed for Antenna transmission. (Frequencies, used by the military, is such a exemple). So first you need to add the non-standard frequencies to you're local_conf.py file. This is a illustrated example of my TV_CHANNELS settings

    TV_CHANNELS = [
        ( 'bbcworld', 'BBC World', 'bbcworld' ),
        ( 'bbc1', 'BBC1', 'bbc1' ),
        ( 'bbc2', 'BBC2', 'bbc2' ),
        ...

The last parameter of every item in the list will be mapped to a frequency

So this is a part of my FREQUENCY_TABLE The frequencies are in Khz

    FREQUENCY_TABLE = {
         'bbcworld' : 294250,
         'bbc1': 266250,
         'bbc2': 273250,
         ...

Check with you're local cable tv supplier (website?) to find out.

This would work correctly with Tvtime, but not with mencoder. As you see in this example, it will try to pass a channel parameter I have defined in freevo to mencoder

    2004/07/28 22:40 CEST [*RecordServer*] popen
    /usr/bin/mencoder tv:// -tv driver=v4l2:input=0:norm=pal:channel=bbcworld...

A channel setting mencoder doesn't understand.

Basically a tvtuner will tune in with a specific frequency and is not aware of channels. Channel descriptions are different, regarding the standard (pal,secam,ntsc) or the country you're living in. As I described above, Cable operators don't have to follow these conventions, cause they where designed with antenna broadcast in mind.

I've modified the VCR_CMD to use a frequency instead of channels. The mencoder recording program supports the use of freq instead of channels.

    #           ':channel=%(channel)s' +        # Filled in by Freevo
    #           ':freq=%(frequency)s' +        # Filled in by Freevo
               ':freq=%(frequencyMhz)s' +

The frequency in Khz defined in FREQUENCY_TABLE needs to be divided by 1000, since mencoder uses the frequency in Mhz

To be able to introduce the parameter frequencyMhz, wich is identical to default parameter frequency, except it's using Mhz instead of Khz as required by mencoder I modified the file ....freevo/tv/plugins/generic_record.py

These are my modifications

     def Record(self, rec_prog):
            frequency = self.fc.chanSet(str(rec_prog.tunerid), 'record plugin')
           # modif gedeco
            frequencyT = str(frequency)
            frequencyT1 = len(frequencyT)
            frequencyleftpointer = frequencyT1-3
            frequencyA = frequencyT[0:frequencyleftpointer]
            frequencyB = frequencyT[frequencyleftpointer:frequencyT1]
            frequencyMh = frequencyA + '.' + frequencyB
            frequencyMhz = str(frequencyMh)
           # end modif gedeco
            rec_prog.filename = tv_util.getProgFilename(rec_prog)

            cl_options = { 'channel'  : rec_prog.tunerid,
                           # modif gedeco
                           'frequencyMhz' : frequencyMhz,
                           # modif gedeco
                           'frequency' : frequency,

A python programmer will find this probably a kludge --- which it is. I'm not a programmer. So somebody capable of streamlining this, go ahead. But using the frequency would be a much better way to drive mencoder, cause both are depending on different channel lists. Made to confuse.

Thnx to Mick, who put me on the right track

last edited 2005-01-25 14:42:38 by JohnMolohan
current version: http://freevo.sourceforge.net/cgi-bin/doc/Analoguefreq