Jump to content

New EPG/Channel Docs


Recommended Posts

There is new (reworked) documentation about the channels.dat / epg.dat file structure available (members area -> source section-> epg.dat/channels.dat structure). It contains some corrections and additional information about messages letting DVBViewer import/export data.

 

Please note: The epg.dat file format will be changed from version 1.7 to 1.8 in coming DVBViewer versions. The format of EPG data transfer via memory and epg.tmp files will follow some time later (1.0 -> 1.1).

 

Add On / Plugin developers that access the epg.dat / epg.tmp file resp. use the memory transfer are strongly recommended to support both format versions (at least for some time). The new documentation contains all necessary information.

Link to comment

Hi,

i have a bit of confusion about epg.tmp structure.

I just manage easy epg.dat, but i understand that is a "nice" way said to DVBViewer to export epg.tmp, modify it and recall DVBViewer for importing the new epg.tmp .

 

So, according with the new epgformat.txt, i modify my application for doing this job.

 

But probably i dont understand well, because if i use this structure :

// The format of the epg.tmp transfer file

FormatVersion: Word; //*** currently 0x0100, 0x0101 will be used in future!

while not EndOfFile do
//channel identification
 ServiceID: Word;
 TransportStreamID: Word;

<CUT>

I just found some non correct data, as ServiceId and TransportStreamID.

Not working too if i use a Info: DWord and i use LoWord(Info) and HiWord(Info) for take them as in epg.dat .

 

But if i use the same way i got data from epg.dat*, things appears goes well but when i try to get NrOfEvents i got a to much big number that surely isnt the right one.

 

*using this struct :

FormatVersion: Word //*** currently 0x0107, 0x0108 will be used soon!
TimeZone: Double; //TDateTime
while not EndOfFile do
 ChanId: DWord;

 if FormatVersion >= 0x0108 //*** new format!
OriginalNetworkID: Word;
Tunertype: Byte;
  //0 = undefined, 1 = cable, 2 = satellite, 3 = terrestrial, 4 = ATSC
Reserved: Byte; //= 0
 endif

 NrOfEvents: DWord; //Number of stored events for this channel
 for i := 0 to NrOfEvents-1 do
<CUT>

 

Please, i'd like to use epg.tmp for a better use.. but i really dont understand where i make the mistake.

 

I understand that you arent here for helping us to code but for your "business" (meaning : coding, supporting, have your happy time with friends.. everything you like), so if you say a "Stop try to coding if you are too stupid to understand a so easy thing", will do it is job.

 

Btw, i'll still code and i'll use epg.dat, but at least i'll do not ask more stupid question. ;-)

 

Thank you very much in advance and sorry if i wast your time reading me.

Luke

Link to comment

Sorry, there is an error in the documentation :bye: One line got lost. It must be

 

// The format of the epg.tmp transfer file

FormatVersion: Word; //*** currently 0x0100, 0x0101 will be used in future!
TimeZone: Double; //TDateTime

while not EndOfFile do
 ...

 

I will re-upload it...

Link to comment
  • 2 years later...

Hi,

 

one remark and one question about the epg/channel documentation.

 

1. for epg.dat:

TimeZone: Double; //TDateTime

//TDateTime is a double floating point value. The integer part contains the

//date (number of days since 12.30.1989). The fractional part contains the time.

 

This is a typo, it must be 12.30.1899 !

 

2. The tunertype definition in EPG and Channels differs from each other, is this an error in documentation or really supposed to be like this?

 

epg.dat

Tunertype: Byte;

//0 = undefined, 1 = cable, 2 = satellite, 3 = terrestrial, 4 = ATSC

 

channels.dat

TunerType: Byte; //0 = cable, 1 = satellite, 2 = terrestrial, 3 = atsc

 

Thanks!

Edited by xck3001
Link to comment
  • 10 months later...

Hi! thanks for the extensive documentation!

 

the 1989/1899 typo is still in the docs. Took me a while to figure out what the right date was (was using 1-1-1900 and it was always off by 2 days :)).

 

some other things I've noticed:

1. Tuner Reserved-7 and 8 together form the 3-letter language-identifier of the channel

2. I cannot get Tuner's AVType (Low Nibble (Bit 0..3): audio format, High Nibble (Bit 4..7): video format) to parse correctly. the numerical value within the file is 0x10. But I am missing the Video identification H264 for HDTV channels. I'm not able to see this flag encoded anywhere in the channels.dat file! Is this a bug or a feature? ;)

 

I've created a modular C# library and a sample Smart-Client application for browsing the channels and EPG data, aswell as adding timers using the RecordingService's web API. I am also just adding a windows-service which will perform the searches daily and auto-add timers accordingly. There's already EPG+ for a similar purpose, but I want this to work without having to login to my server and I need some more intelligence in choosing the right movies to record. The functionality is modular, so anyone wanting just the interaction or parsing functionality can use just those assemblies. If anyone is interested, I can send the code or put the project on codeplex.

Link to comment

I've created a modular C# library and a sample Smart-Client application for browsing the channels and EPG data, aswell as adding timers using the RecordingService's web API. I am also just adding a windows-service which will perform the searches daily and auto-add timers accordingly. There's already EPG+ for a similar purpose, but I want this to work without having to login to my server...

Otherwise you have the Autosearch Timer in RS that performs the same thing based on saved search presets. Requires no login to the server and in the search presets you can choose from a viarity of criterias (Intelligence).

 

...and I need some more intelligence in choosing the right movies to record.

Intresting, do tell more! What criterias will you work with then? Edited by majstang
Link to comment
  • 4 weeks later...

hi, sorry for my late reply. did not get a mail that the post was answered, so I noticed this just now.

 

here's some things I am currently missing and have implemented in my work:

 

1. multiple include/exclude criteria. Why? well, some german stations also broadcast the same movie in different languages and I don't want french stuff. It's only detectable, because the station will write some stuff into the title (argh!!)

 

2. regex support, while we're at it

 

3. specify preferred format (try H264, if found on a HD channel, otherwise fallback to other formats)

 

4. don't add number suffix from timer's name, making it possible to have ONE directory for the same series

 

BTW: I've fixed the H264 detection problem: "your" striving to save a bit was not encompassed in my code (I thought bit-1 is 1, not 0). this awkward format make (de-)serialization ugly, as I have to have a 2-pass run. I don't like the UI having to decide "oh, no bit is set, then it must be default X"; that's bad design in my opinion.

 

regards, Tilli

Link to comment
  • 2 weeks later...
  • 5 months later...

To add to comments on "Reserved" fields in Channels.dat:

 

Reserved5 is satellite position, in tenths of a degree East (Astra 2 is 282, Hispasat is 3300)

Reserved6 contains EPG collection types

// 0 = DVB EPG

// 1 = MHW, SFI EPG

// 2 = External EPG

Reserved7 & 8 is audio language, as noted above

 

Others are all empty in my file.

Link to comment
  • 2 years later...

The channels.dat / epg.dat file structure documentation has been updated in the customer area -> source section.

 

Remark: Unfortunately there have been no real efforts in the past to keep the DVBViewer Pro epg structures consistent. Particularly the current DVBViewer Pro 0x0100 export format is neither compatible with the 0x0100 format described in former versions of this specification resp. the DVBViewer GE import/export 0x0100 format, nor with the DVBViewer Pro 0x0100 import format (!).

 

Sorry for that - I had no influence on it. I had to reverse-engineer most of the DVBViewer Pro epg handling from code (including the current epg.dat format 0x0109 that is also used by up-to-date Recording Service versions) because it has never been documented. I tried to make the best out of this situation. Maybe some of it is usable... ;)

Link to comment
Thanks a lot. Just a few questions:


1)


I want to set the EPGFlags byte to only allow External EPG (DVBViewer Pro) for certain channels (The paired ones in Xepg).


From ChannelFormat.txt:


EPGFlags: Byte;

//DVBViewer Pro only

//The following bits are set for exclusion:

//Bit 0: All EPG

//Bit 1: Standard DVB/ATSC EPG from EIT

//Bit 2: MHW EPG

//Bit 3: External EPG


From this EPGFlags should be 2^1 + 2^2 = 6


However, if I GET the Recording Service api /api/getchannelsxml.html?tuner=3, I get




<?xml version="1.0" encoding="utf-8" ?><channels><root name="Kabel (QAM 64)"><group name="Stofa"><channel nr="0" name="NatGeo Wild HD" EPGID="281479272989813" flags="24" ID="3431743002585007221" ><tuner tnrtype="0" group="0" flags="24" freq="426000" symb="6900" LOF="0" PMT="141" satmod="0" AVformat="16" FEC="0" pol="5" OrbPos="4000" Tone="0" EPGFlag="3" DiSEqCVal="0" DiSEqC="0" alang="eng" APID="1411" VPID="1410" TSID="20" TelePID="0" NID="1" SID="1141" PCRPID="1410" /></channel>
...


Here EPGFlag="3" (The flags are set using the DVBViewer Pro channel editor). This is not nessecarily a contradiction, but a bit confusing. Can you enlighten me and save me some time?


2)


I want to use


PostMessage(Handle,0xB2C2,0x1033,0);

//DVBViewer reloads the channels.dat file.


(Would prefer a COM sendCommand number, though. Actually it should load the channellist from Recording Service if set up to do so, right?)


Can I force the Recording Service to reload the channellist accordingly?


TIA

Link to comment
I want to set the EPGFlags byte to only allow External EPG (DVBViewer Pro) for certain channels (The paired ones in Xepg). (...) Here EPGFlag="3" (The flags are set using the DVBViewer Pro channel editor).

 

I've checked it, and the documentation is obviously wrong. It must be

 

EPGFlags: Byte;
//DVBViewer Pro only
//The following bits are set for exclusion:

//Bit 0: Standard DVB/ATSC EPG from EIT

//Bit 1: MHW EPG
//Bit 2: External EPG
so EPGFlag = 0 means all EPG. It's a misunderstanding that happened in 2008, as my email archive revealed. I will correct the file it in the customer area accordingly.
Can I force the Recording Service to reload the channellist accordingly?

 

No. As a service it is running in a system account, not in your user acoount, and it has no window resp. desktop UI that can receive such a message.

 

Furthermore I've seen nothing in the RS code that could be a regarded as an invitation for changing the channel list while the service is running. Looks like it is not prepared for it.

 

So no go.

Link to comment
No. As a service it is running in a system account, not in your user acoount, and it has no window resp. desktop UI that can receive such a message.

 

 

I obviously did not make myself clear. I was thinking of a HTTP GET command, That's possible.

Well, it would be nice, but is not that important. I can just tell the user to stop and start the RS if it is running at the time being.

 

Most importing thing is, that it is now possible to manipulate the EPGFlags, so thanks once again for documenting. Moreover I can tell the user to close DVBViewer if it is running, then everything should be fine.

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...