MEI Format for EPG data

The MEI format was designed by Bawbagg to address the limitations of the internal Toppy EPG data storage. Originally "MEI" stood for something else, but it now has a wider audience and can be considered to stand for:

More EPG Info

The format is extendible and old parsers (if correctly written) will simply ignore the extra fields in newer format files. The following sections describe the format in more detail.

— General Description —

MEI data is stored in a plain text format with a "|" separating each field. There is an initial 6-digit record length field which allows a quick way to skip over records and simplifies parsing. Records are (usually) separated by the standard PC line ending. For example:

000064|200902202100|200902202130|1|QI|The Future||||||Panel-based quiz.

This specifies a single record with 11 fields included, starting with "200902202100" (the consecutive "|" mean that those fields are blank). The initial "000064" is the length of this record's text (after the "|"). After this record there will be a line ending, then the start of any new record.

Because "|" is special, it cannot occur in any field text. Tools may have extra constraints or requirements on the format of the data. Most commonly, this is just a specific ordering, but some existing parsers do not expect line endings anywhere else in the record text, so this prevents including line endings in, say, the programme description field.

— Current Format —

Required fields (for most tools) are marked with "*". Most tools require that the data is sorted in chronological order within LCN. The safest thing is to sort by LCN and then start time (with inevitable confusion around the autumn DST change).

0.Record Length * 6-digit string (with leading zeroes) giving the length of the record text (after this field's "|" separator).
1.Start Time * The start date and time in the format YYYYMMDDHHMM (this should be in local time active at that point).
2.End Time * The end date and time, as above.
3.Channel * The LCN of the channel, e.g. "1" for BBC1 in UK's Freeview.
4.Title * Programme title, e.g. "Friends"
5.Episode Name Programme sub-title/episode name, e.g. "The One With The Monkey".
6.Repeat Non-blank if it has been shown before.
7.New Non-blank if it is a new series.
8.Year Production year (for films).
9.Premiere Non-blank if it is a premiere (for films).
10.Last Chance Non-blank if it is a last chance.
11.Description Complete programme description.
12.Category Genre, e.g. "Documentary".
13.Duration Length of the programme in minutes.
14.Aspect Ratio 16:9 or 4:3.
15.Colour/BW "B&W" if black and white.
16.Subtitles Type of subtitles: "onscreen" for foreign language (films), or "teletext" if optional.
17.Episode Number Episode number, e.g. "2/6".
18.Episode System e.g. "onscreen" for uninterpreted data, or "xmltv_ns" for XMLTV format.
19.Rating System Age rating system, e.g. "BBFC".
20.Rating Age rating, e.g. "18" or "PG".
21.Star Rating Review rating, e.g. "3/5" (RadioTimes stars out of five).
22.CRID Episode Series Link data for this "episode".
23.CRID Series Series Link data for this "series".
24.CRID Recomm Series Link data for recommended related programmes.
25.Event ID Unique identifier for this programme (on this channel) — used by broadcast EPG data.

— Proposed Extensions —

To enable non-LCN systems to be able to use this format, the channel name needs to be specified. This may also prove useful when channels change LCN, or as an extra layer of validation.

To handle DST changes the format specification should be tightened to require the duration to be specified (at least near the DST change), since the start and end times are in local time and so may not indicate the duration properly. There is still the possibility of confusion in the autumn, so an additional field is needed to indicate whether the start is in DST (at least near that DST change).

Most systems can gather an EPG from broadcast data. This will usually have the benefit of accuracy, but the descriptions may be lacking. Alternative descriptions are best supplied as separate fields in order to maintain the integrity of the data.

Fields that contain a list of data will have members separated by "~".

26.Channel Name    Name of the channel, for non-LCN systems especially.
27.Start Offset Non-blank flags that the start time is in DST. Exceptions are when it is in the format "+MMM" or "-MMM", which give the full offset of the start time from GMT (in minutes).
28.Desc Source Source of the main description, e.g. "EIT" for broadcast data.
29.Extended Info Extra (long) description, gathered from broadcast data. This will depend on regional usage, but a simple tool may combine with the Description.
30.Extended Item List A list field. Gathered from broadcast data, this will depend on regional usage, and one possible (unconfirmed) use is a cast list. List members are in the format "Item*Desc" (e.g. "Writer*H.G. Wells"). In the UK, broadcast CRID (Series Link) data may have been inserted here.
31.Alt Description Alternative description, e.g. RadioTimes review.
32.Alt Desc Source e.g. "RadioTimes".
33.Choice Non-blank if the programme is a "pick of the week".
34.Deaf Signed Non-blank if it is signed.
35.Cast List A list field. List members are in the format "Character*Actor", with names given as "FirstName LastName".
36.Director Mainly for films.
37.Studio Mainly for films.
38.Private Data that is private to the MEI generator. For example, the first record may use this field to show the name of the generator and the options used.

— History —

V1 contained fields 0-21.

V2 added fields 22-25.