[vdr] Re: cReceiver vs cFilter and PTS questions

Marcel Wiesweg marcel.wiesweg at gmx.de
Fri Nov 4 23:09:44 CET 2005

> Hello
> I have a couple of questions.
> 1. whats the differents between cReceiver and cFilter?
> I was first exposed the cFilter is set for only one PID and the
> cReceiver can get all Pakets from the whole stream. But now I think the
> cReceiver can't get all the Pakets because the bandwidth of the
> pci/usb/.. can't be enough. So what is the differents? Im not so long in
> this list but I think this question sould picked up in the PLUGINS.html

This might be a FAQ, so a longer answer:

A cFilter is a layer above cReceiver and has a much more specific purpose then 
a cReceiver.

With DVB, you have different sorts of data:
-Audio, Video, Teletext, ...
-Program Specific information (PSI) aka Service Information (SI) (such as EPG)
All data is delivered in 188 byte TS packets.
With a cReceiver, you request one or more transport streams, identified by 
their pids.
For audio or video, you unpack the payload and then you have a PES stream 
(once again with a header and a payload, but much larger packet size).

Program specific information is different. It is formatted in tables (PAT, 
PMT, CAT, EIT, NIT, SDT, TOT, TDT, the first three defined in iso 13818-1, 
the latter in ETSI EN 300 468). These tables are split into sections. (If you 
read the standards, you find the definitions of the _sections_, the table is 
merely the collection of all sections it is split into. VDR, in pat.c, eit.c, 
sdt.c, always deals with the sections.)
Every table/section has a specific table ID.
Sections are put in the payload of the TS packets, split if necessary. See 
section 5.1.2 of 300 468 for details.
These transport streams containing the SI sections are broadcast mostly at 
predefined PIDs. E.g. PID 0x00 is always the PAT. (see section 5.1.3) The PMT 
pids are not defined, they can be found in the PAT.
Now you can construct a cReceiver, get the TS packets, unpack them, buffer 
them, get the starting point of a section, and extract the sections. Or you 
let the driver do that for you and construct a cFilter, which takes the PID 
and the table ID (confusingly called Tid in the code, which also stands for 
Transport Stream ID in other places)

> 2. I want to get the PTS from the current V-PID. I have looked at the
> femon Plugin. This use a cReceiver which gives me an repacked TS with
> 188byts.

> I have surched for a Spec. which gives me more informations 
> about the 188Byts.

You have that version of ISO-13818-1 circulating on the internet?
Google gave me http://www.le-hacker.org/hacks/mpeg-drafts/is138181.pdf if you 
do not.

> The first 16bit (12bit used) are the PID
> 8bit are the (PAYLOAD/ADAPT_FIELD)(don't know what it is)
> 8bit some kind of offset
> ......
> then femon sets a pointer to the receved paket+offset (named sb)
> next femon sets a new pointer to sb + sb[8] + 9 (named pay)
> after all pay shows to the video, audio or AC3 data.
> But how to get the PTS?

I know you know my MHP plugin. In libmhpoutput/mpegpes-common, there is a file 
pesheaders.h which contains a definitions for PES header structures. The 
corresponding function PESBuilder::SendData where data is wrapped in PES 
packets is unfortunately not as easy to read.
If I remember correctly, the bitstreamout plugin contains optimized code to 
retrieve the PTS.


> 3. I want to get all PTS from all V-PID's on the transponder. Is it
> possible?
> Yours sincerely
> Patrick
> _______________________________________________
> vdr mailing list
> vdr at linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

More information about the vdr mailing list