WIP: DVB-C support

John-Mark Gurney jmg at funkthat.com
Thu Dec 31 02:04:52 UTC 2009


Max Laier wrote this message on Wed, Dec 30, 2009 at 03:41 +0100:
> I'm looking for a good MPEG-TS de-multiplexer with PSI support.  If you know 
> of such a thing, let me know.

It's not great, but I have my pydcap tools in FreeBSD's p4 tree:
http://p4db.freebsd.org/fileSearch.cgi?FSPC=%2F%2Fdepot%2Fuser%2Fjmg%2Fbktrau%2Fpython%2F...&ignore=GO!

It has a DeMuxer class that you subclass, and you get notifications
of when the PSI changes, and when data arrives...  I use it for my
custom PVR I wrote, and the sub-class I use is:
class TunerDemuxer(pydcap.demux.DeMuxer, dict):
        def __init__(self):
                pydcap.demux.DeMuxer.__init__(self)
                dict.__init__(self)

        def setupchange(self):
                for i in self:
                        self.recordstream(i, self[i])

        def data(self, program, data):
                for i in program:
                        i.write(data)

        write = pydcap.demux.DeMuxer.demuxdata

dm = TunerDemuxer()
dm[(5, 1)] = [ open("kcbs.ts", "a+b"), ]
while True:
	dm.write(readdata())

You deliver data to demux via the write method, and TunerDemuxer will
then call the write method on each object in the list..  This lets me
also record the intro/outro to two different files w/o much additional
work (append the new show to the list, and then once the old show is
done, remove it)...

The core part of the demuxer is written in C so the performance is
acceptable...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."


More information about the freebsd-multimedia mailing list