LineupProposal

From XMLTV
Jump to: navigation, search

Lineup Proposal

Proposal by Mattias Holmlund.

(There is an alternate proposal on LineupProposal2).

This page describes my proposal for a new capability for grabbers that I call "lineups". It has not yet been decided on and no grabber implements it.

The problem as I see it is that we need a way for applications such as MythTV to connect the channels that it can find on a videosource (a TV-card for example) to the xmltvids that it gets from the xmltv grabber. Each channel contained in an xmltv-file can be a part of several different lineups. This means that we need to be able to supply several different mappings for one channel. The mapping for a channel will also differ depending on which lineup the user has selected. Therefore, I think we need to have the lineup information separate from the channel-section of the xmltv-file. Note that the lineup information can in some cases contain mappings for channels that the grabber does not have schedule data for.

Furthermore, I don't think we need to include the lineup information every time the grabber downloads schedules data. The PVR application will typically need lineup-information after a channel scan or when it detects that something has changed in the lineup via other means (changed service-name in an mpeg-stream etc.) The lineup-information will for at least some grabbers not come from the same source as the data. I would guess that at least some of the grabbers would fetch the lineup-data from community-run sites, and I think we can save a lot of bandwidth for these sites if we only download lineup-data when the PVR application really needs it.

The mapping from tuning data to xmltvid is different for different providers. However, it is also different depending on the type of videosource. For analog TV, the mapping can be expressed as a frequency to xmltvid mapping. For DVB-T, several channels can share a single frequency (multiplex) and it is pretty easy to scan all frequencies, so there we can use the provider-name and service-name inside the MPEG-stream and map it to an xmltvid instead. For IP-TV, we can map a url for the stream to the xmltvid. For IP Multicast-TV we map a multicast IP address and port-number to the xmltvid.

These mappings can be described in lineups. A lineup contains a set of channels that a customer can order from his provider. I would propose that lineups are not included in the xmltv-format and that they are instead described in separate xml-files. We can write the DTD as a part of the xmltv-project, but it should be separate from the current xmltv dtd.

A sample lineup could look like this:

   <xmltv-lineup type="DVB-T">
      <display-name lang="sv">Boxer Fri Stockholm</display-name>
 
      <channel id="svt1.svt.se">
        <display-name lang="sv">SVT 1</display-name>
        <provider-name>Sveriges Television</provider-name>
        <service-name>SVT1</service-name>
     </channel>
 
      <channel id="svt2.svt.se">
        <display-name lang="sv">SVT 2</display-name>
        <provider-name>Sveriges Television</provider-name>
        <service-name>SVT2 ABC</service-name>
     </channel>
   </xmltv-lineup>

Note that there is a display-name for each channel even though this display-name can be found in the xmltv-file. The reason for this is that we might not have data for all channels, and then the user will at least have a display-name.

The grabber shall support two new command-line options: --lineup and --list-lineups. They are used as follows:

First, the application lets the user configure the grabber just as before. During the configuration, the grabber asks the user questions so it can learn which lineups the user has access to. How this is done is up to the grabber, but typically the user will be able to choose between a set of lineups somehow. The user shall be able to select several lineups at once. If a user chooses one or more lineups, it will probably not make sense to ask the user which channels he wants to download data for, since this is given by which lineups he has chosen.

When the configuration is done, the application can ask the user which lineups the user has chosen with the --list-lineups parameter:

   $ tv_grab_se_swedb --list-lineups
   stockholm.fri.boxer.se|DVB-T|Boxer Fri Stockholm
   total.canalplus.se|DVB-S|Canal+ Total

The application can then ask for detailed information about each lineup with the --lineup parameter:

   $ tv_grab_se_swedb --lineup stockholm.fri.boxer.se
   <xmltv-lineup type="DVB-T" id="stockholm.fri.boxer.se">
      <display-name lang="sv">Boxer Fri Stockholm</display-name>
 
      <channel id="svt1.svt.se">
        <display-name lang="sv">SVT 1</display-name>
        <provider-name>Sveriges Television</provider-name>
        <service-name>SVT1</service-name>
     </channel>
 
      <channel id="svt2.svt.se">
        <display-name lang="sv">SVT 2</display-name>
        <provider-name>Sveriges Television</provider-name>
        <service-name>SVT2 ABC</service-name>
     </channel>
   </xmltv-lineup>

Lineup types

We need to define the lineup-format for all available types of TV-sources and preferably radio as well.

List

The simplest type of lineup is the "list". This only contains a list of channels with a display-name and an optional preferred-preset. It is useful in cases when we don't have any other information available. It cannot be used to map channels to xmltvids, but it can be used to select a set of channels that you want to receive data for.

   <xmltv-lineup type="list" id="stockholm.fri.boxer.se">
      <display-name lang="sv">Boxer Fri Stockholm</display-name>
 
      <channel id="svt1.svt.se">
        <display-name lang="sv">SVT 1</display-name>
        <preferred-preset>1</preferred-preset>
     </channel>
 
      <channel id="svt2.svt.se">
        <display-name lang="sv">SVT 2</display-name>
        <preferred-preset>2</preferred-preset>
     </channel>
   </xmltv-lineup>

The preferred-preset field tells the application which "button on the remote" this channel should preferably be connected to. This field is optional.

All other lineup-types are extensions of the list-type.

DVB-T

For DVB-T, it is fairly easy for an application to scan all available frequencies and find all channels. Therefore, we don't need to include the frequencies in the lineup. Instead, we only include enough information to allow the application to uniquely identify each channel. Each channel in a DVB-T stream is identified by a provider-name and a service-name, so we can use these.

   <xmltv-lineup type="DVB-T" id="stockholm.fri.boxer.se">
      <display-name lang="sv">Boxer Fri Stockholm</display-name>
 
      <channel id="svt1.svt.se">
        <display-name lang="sv">SVT 1</display-name>
        <preferred-preset>1</preferred-preset>
        <provider-name>Sveriges Television</provider-name>
        <service-name>SVT1</service-name>
     </channel>
 
      <channel id="svt2.svt.se">
        <display-name lang="sv">SVT 2</display-name>
        <provider-name>Sveriges Television</provider-name>
        <service-name>SVT2</service-name>
        <preferred-preset>2</preferred-preset>
     </channel>
   </xmltv-lineup>

One advantage of not including the frequencies is that the number of different lineups decreases. This is because several different regions can use the exact same lineup even though they use different frequencies. In Sweden for example, we have roughly 50 different transmitters operating on different frequencies, but the country is only divided into five different regions for lineups.

I think that DVB-S and DVB-C can use the same format and possibly also ATSC. So we might want to call the lineup-type DTV instead.

Analog TV

For analog TV we have to use the frequency to identify the channel since there is no other channel identifier available.

Should we use frequenzies (in Hz) or frequency numbers? Do the channel numbers mean the same frequency in all countries? How about Analog Cable?

   <xmltv-lineup type="Analog" id="chateau.latresne.33.fr">
     <display-name lang="fr">33 - Latresne - Chateau d'Eau</display-name>
 
     <channel id="france2.fr">
       <display-name lang="fr">France 2</display-name>
       <preferred-preset>2</preferred-preset>
       <frequency-number>31</frequency-number>
     </channel>
 
     <channel id="france3.fr">
       <display-name lang="fr">France 3</display-name>
       <preferred-preset>3</preferred-preset>
       <frequency-number>34</frequency-number>
     </channel>
   </xmltv-lineup>

IP TV

Identify each channel with a url such as rtsp://...

IP Multicast TV

Identify each channel with an IP multicast address and a port-number.

STB

In some countries, it is common with computers that get their video signal from an STB (Set-Top Box) and to change the channel, you have to tell the STB to change to a different preset.

   <xmltv-lineup type="STB" id="stb.stockholm.fri.boxer.se">
      <display-name lang="sv">Boxer Fri Stockholm</display-name>
 
      <channel id="svt1.svt.se">
        <display-name lang="sv">SVT 1</display-name>
        <preferred-preset>1</preferred-preset>
    <preset>1</preset>
     </channel>
 
      <channel id="svt2.svt.se">
        <display-name lang="sv">SVT 2</display-name>
        <preferred-preset>2</preferred-preset>
        <preset>2</preset>
     </channel>
   </xmltv-lineup>

Note the difference between preferred-preset and preset here. preset is the number that you have to tune the STB to to receive the channel. preferred-preset is the channel number that the user will likely prefer to have the channel mapped to on the remote to his computer. These two fields will likely contain the same value, but they are separate.