Log in Register FAQ Memberlist Search pcHDTV Forum Index
pcHDTV Forum

pcHDTV Forum Index -> HDTV programming and listings -> Guide data in PSIP Goto page 1, 2, 3  Next
Post new topic  This topic is locked: you cannot edit posts or make replies. View previous topic :: View next topic 
Guide data in PSIP
PostPosted: Mon Oct 06, 2003 6:54 am Reply with quote
dlarrick
 
Joined: 22 Sep 2003
Posts: 58
Location: Outside Boston, MA




According to my reading of the ATSC standards, broadcasters are required to supply guide data, in the form of PSIP packets, in the broadcast stream itself. They must provide show titles & durations, and may optionally supply descriptions, for at least 12 hours' worth of programming.

If this requirement is actually being adhered to, then code could be written for MythTV to get guide data by periodically tuning to each station received. This data could conceivably even be accurate in the face of sports or other programming delays.

The relevant standards are ATSC Standard A/65B and A/69, available in PDF from http://www.atsc.org/standards.html

dtvscan (on the pcHDTV CD) already looks at some PSIP data, so could be a good framework for someone to experiment with reading it all.

-Doug
View user's profile Send private message AIM Address
PostPosted: Mon Oct 06, 2003 1:37 pm Reply with quote
elwood
 
Joined: 26 Sep 2003
Posts: 67
Location: Phoenix, AZ




Thanks for the link! After scanning the two applicable PDFs, it seems within reason that we should be able to pull this out of the stream.

Also, saw in there that they recommend the streams carry 3 days of program info as a rule of thumb. Lets hope the broadcasters are using this!

Brad
View user's profile Send private message
PostPosted: Sat Oct 11, 2003 8:20 pm Reply with quote
elwood
 
Joined: 26 Sep 2003
Posts: 67
Location: Phoenix, AZ




As an experiment I modified the scan.c sample file to search for EIT tables in the ATSC stream, and found none in the Phoenix broadcasting area.

If others are interested, they might search their areas. PM me for the source if you are interested.

Brad
View user's profile Send private message
EPG
PostPosted: Tue Oct 14, 2003 10:45 pm Reply with quote
guest
Guest
 




I don't have this card, but I do have a hipix. It does have the ability of displaying each channels EPG, but most of the local channels (SF Bay area) were not broadcasting schedule information (last I checked several months ago.) The hipix software tended to crash if you looked at the EPG, so I have not used it in a while. Also, the software would not cach the guide data, but would download it every time you went to display the channels schedule. This took about 30 seconds (NOT user friendly).

If you try to implement this, see if you can't cach the guide of the channel that is currently being watched, then when one is displaying the guide for one channel, go download and cache the guides for the other channels.
PostPosted: Tue Oct 14, 2003 10:54 pm Reply with quote
DAP
Guest
 




or better yet, show all channels at once, adding in listings as they are cached, and keep them cached between uses (and even runs of the program) until they are no longer valid, but while displaying, monitor the channels in case new data is available.
Boston-area not so hot
PostPosted: Mon Oct 27, 2003 6:07 am Reply with quote
dlarrick
 
Joined: 22 Sep 2003
Posts: 58
Location: Outside Boston, MA




I finally got some more time to look at this.

Elwood, the reason the example code you sent me didn't find anything is that the actual EIT/ETT tables are not in the PSIP PID itself, but instead are in a PID referenced by the MGT (which is part of the PSIP PID). I have some code working far enough to be able to tell what EIT/ETT tables are present, and their size, but not (yet) their content.

The good news is that all Boston-area broadcasters have at least the required 12 hours' worth of guide data (EIT-0 thru EIT-3). The bad news is that only two broadcasters (WGBH and WCVB) have ETT tables at all, and only WCVB has any significant data in them (WGBH's are all the same length). It will be interesting to see what the data looks like.

-Doug
View user's profile Send private message AIM Address
PostPosted: Mon Oct 27, 2003 8:36 am Reply with quote
elwood
 
Joined: 26 Sep 2003
Posts: 67
Location: Phoenix, AZ




Hey thats good news Doug!

Would you be able to send a copy of the source code back to me if it cannot be attached to the forum post?

About three others had tried my code and also came up with nothing, so I was beginning to suspect that something was wrong with my modifications.

Thanks,
Brad
View user's profile Send private message
Sources
PostPosted: Mon Oct 27, 2003 9:40 am Reply with quote
dlarrick
 
Joined: 22 Sep 2003
Posts: 58
Location: Outside Boston, MA




I've actually written a standalone ATSC MPEG-TS parser / sandbox program to ease my debugging of MythTV's pcHDTV support (since my pcHDTV is not in my development box), and that's where I implemented the PSIP decode stuff. It's substantially similar to what's in MythTV, with portions borrowed from bbinfo and from dtvscan.

You can find the source on my home machine: testinfo.C. This is a C++ file. Be forewarned that, like I said, this is a sandbox program for me and I'm not really maintaining it, just hacking at it to try things out before I implement them in Myth. Thus there's a whole bunch of vestigal code in there.

-Doug
View user's profile Send private message AIM Address
PostPosted: Mon Oct 27, 2003 10:26 am Reply with quote
elwood
 
Joined: 26 Sep 2003
Posts: 67
Location: Phoenix, AZ




Doug,

I like the code, seems like a good sandbox. I too will be in the situation where my dev box is not my HTPC.

I'll give this a run tonight and see what comes through...

Brad
View user's profile Send private message
psip data
PostPosted: Mon Oct 27, 2003 11:28 am Reply with quote
zzo
 
Joined: 14 Oct 2003
Posts: 12
Location: San Jose, CA




VERY AMUSING!

I'm in San Jose, CA
A local channel gives me:

Program #3: KSTS-DT, channel 48-1
Base PID 0031:
PID 0031, type video, language: eng
PID 0034, type AC3 audio, language: eng
PID 0035, type AC3 audio, language: eng
Program #4: KNTV-DT, channel 48-2
Base PID 0041:
PID 0041, type video, language: eng
PID 0044, type AC3 audio, language: eng
Decoding PSIP table
Unsupported proto version 255

While the local NBC affiliate just gives:
Packet #296, PSIP pid
Found PSIP pid
New table size 135 at 55766
Done with table at 55901
New table size 1482 at 55901
Decoding PSIP table
************PSIP table type MGT (Master Guide Table) size 135
MGT entry: type RRT PID 1ffb size 0x0072
MGT entry: type ETT for EIT-0 PID 1e00 size 0x00d8
MGT entry: type ETT for EIT-1 PID 1e01 size 0x00fc
MGT entry: type ETT for EIT-2 PID 1e02 size 0x00fc
MGT entry: type ETT PID 1e80 size 0x0028
MGT entry: type ETT for EIT-3 PID 1e03 size 0x00fc
MGT entry: type EIT-0 PID 1d00 size 0x015e
MGT entry: type EIT-1 PID 1d01 size 0x0196
MGT entry: type EIT-2 PID 1d02 size 0x0196
MGT entry: type TVCT PID 1ffb size 0x03e0
MGT entry: type EIT-3 PID 1d03 size 0x0196

interesting stuff.
View user's profile Send private message Visit poster's website
PostPosted: Mon Oct 27, 2003 7:38 pm Reply with quote
elwood
 
Joined: 26 Sep 2003
Posts: 67
Location: Phoenix, AZ




Hey hey kids!

First channel I tried (PBS) had some decent info!

Code:

New table size 80 at 67121
Done with table at 67201
New table size 2547 at 67201
Decoding PSIP table
************PSIP table type TVCT (Terrestrial Virtual Channel Table) size 150
Subchannels: 2
Program #2: KAET-HD, channel 8-1
Base PID 0021:
  PID 0021, type video, language:
  PID 0024, type AC3 audio, language: eng
Program #3: KAET-SD, channel 8-2
Base PID 0031:
  PID 0031, type video, language:
  PID 0034, type AC3 audio, language: eng
Decoding PSIP table
Unsupported proto version 255
Found PSIP pid
Done with table at 222409
New table size 80 at 222409
Done with table at 222489
New table size 2547 at 222489
Decoding PSIP table
************PSIP table type MGT (Master Guide Table) size 80
MGT entry: type RRT PID 1ffb size 0x0099
MGT entry: type ETT PID 0f0a size 0x0056
MGT entry: type EIT-0 PID 0f7a size 0x001c
MGT entry: type EIT-1 PID 0f7b size 0x001c
MGT entry: type EIT-2 PID 0f7c size 0x001c
MGT entry: type EIT-3 PID 0f7d size 0x001c
Decoding PSIP table
Unsupported proto version 255
Found program # 2 PID 32
Found program # 3 PID 48
Found PSIP pid
Done with table at 116566
New table size 80 at 116566
Done with table at 116646
New table size 2547 at 116646
Decoding PSIP table
************PSIP table type MGT (Master Guide Table) size 80
MGT entry: type RRT PID 1ffb size 0x0099
MGT entry: type ETT PID 0f0a size 0x0056
MGT entry: type EIT-0 PID 0f7a size 0x001c
MGT entry: type EIT-1 PID 0f7b size 0x001c
MGT entry: type EIT-2 PID 0f7c size 0x001c
MGT entry: type EIT-3 PID 0f7d size 0x001c
Decoding PSIP table
Unsupported proto version 255
Found program # 2 PID 32
Found program # 3 PID 48
Found PSIP pid


Looking good Doug!

Brad
View user's profile Send private message
PostPosted: Tue Oct 28, 2003 9:45 am Reply with quote
elwood
 
Joined: 26 Sep 2003
Posts: 67
Location: Phoenix, AZ




Doug, so lets see if I understand this for now...

From this info:

Code:

************PSIP table type MGT (Master Guide Table) size 80
MGT entry: type RRT PID 1ffb size 0x0099
MGT entry: type ETT PID 0f0a size 0x0056
MGT entry: type EIT-0 PID 0f7a size 0x001c
MGT entry: type EIT-1 PID 0f7b size 0x001c
MGT entry: type EIT-2 PID 0f7c size 0x001c
MGT entry: type EIT-3 PID 0f7d size 0x001c


We want to create a list of PIDs for each ETT and EIT. With that list, we'll add an else if to the ProcessData() function, which looks for the currently scanned PID in the list of ETT and EIT pids, and then we know we have a table to process?

Brad
View user's profile Send private message
Right
PostPosted: Tue Oct 28, 2003 10:07 am Reply with quote
dlarrick
 
Joined: 22 Sep 2003
Posts: 58
Location: Outside Boston, MA




Yes, you've got it. But seeing that we could potentially end up with a bunch of PIDs that we're watching (there are provisions for up to 127 EITs and their matching ETTs, plus potentially second-language audio PIDs), there needs to be a better way than a big if-then-else block (which could take significant time).

I did something about this (in testinfo) before work this AM. We also need to track which PID is EIT-0 (now), EIT-1 (3 hours hence), etc. since the EIT tables themselves do not know. I have that going as well, but ran out of time before getting it all working this morning. I should be able to polish it up tonight.

I'll post a message here once testinfo.C is working again. Then we'll really see what data's being broadcast around the country.

Decoding the ETT tables may be interesting; I seem to recall reading that they can be Huffman encoded with one of two predefined dictionaries.
View user's profile Send private message AIM Address
Give it another try!
PostPosted: Tue Oct 28, 2003 6:52 pm Reply with quote
dlarrick
 
Joined: 22 Sep 2003
Posts: 58
Location: Outside Boston, MA




OK, I've got testinfo.C whipped into better shape for decoding EIT and ETT tables. Grab it here. Some changes:
- doesn't dump a giant .mpg file to your disk as a byproduct anymore Very Happy
- table-based lookup for deciding which PIDs to watch and what to do with them
- decodes MGT, VCT, EIT, and ETT tables from PSIP

As I suspected, only one station in my area (WCVB) is putting actual data in PSIP Evil or Very Mad The others are either providing program names like "WGBH DTV Broadcast Signal" or just a blank string.

I don't have any code to associate EITs or ETTs with timeslots or channels, and I'm not certain I'm decoding all the fields to do so properly.

Given the paucity of information present right now in my area, I'm gonna refocus my efforts on getting basic subchannel selection working in Myth. If somebody wants to take my code and run with it (or just use it for inspiration), feel free. Jack, if you wanted to include this source in the "tools" directory of the pcHTDV CD, I think some people might find it useful.
View user's profile Send private message AIM Address
PostPosted: Tue Oct 28, 2003 9:40 pm Reply with quote
elwood
 
Joined: 26 Sep 2003
Posts: 67
Location: Phoenix, AZ




Wahoo!

CBS is giving program info, but Doug, i think we've got some alignment issues.

Here's a portion with Navy NCIS showing:

Code:
************PSIP table type EIT (Event Info Table--guide data) size 285
Parsing EIT
  5 events
  0. eid 0x2868 duration 3600 start_time 751428013 title 'Navy NCIS'
  1. eid 0x2858 duration 3600 start_time 751431613 title 'B▼4?'
  2. eid 0x2844 duration 3600 start_time 751435213 title 'a,=~☼'
  3. eid 0x297a duration 2100 start_time 751438813 title '3(k P'
/IUA'd 0x27ee duration 3720 start_time 751440913 title 'U3As_
Unsupported proto version 255
************PSIP table type ETT (Extended Text Table--descriptions) size 54
Parsing ETT
ETM ID 0x03a352 (event description)
Source ID 3 eid 0x28d4
Strings: 1
0. lang eng comp 0x02 mode 0xff len 0x36 'ZOEs Yo►'-▲+↨OY▌♫){Ec►'
Unsupported proto version 255


As you can see, some weird characters.

Ok, quick scan (from the phoenix area):

CBS: has listings as seen above
PBS: A lot of corrupt strings, nothing recognizable
NBC: Good stuff -- show names
ABC: Nothing
UPN: Nothing
FOX: Zero-event EITs

Brad
View user's profile Send private message
Guide data in PSIP
  pcHDTV Forum Index -> HDTV programming and listings
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 7 Hours  
Page 1 of 3  
Goto page 1, 2, 3  Next
  
  
 Post new topic  This topic is locked: you cannot edit posts or make replies.  


Powered by phpBB © 2001-2003 phpBB Group
Theme created by Vjacheslav Trushkin