Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2009 17:27:25 -0800
From:      John-Mark Gurney <jmg@funkthat.com>
To:        Max Laier <max@love2party.net>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: WIP: DVB-C support
Message-ID:  <20091231012725.GA29194@funkthat.com>
In-Reply-To: <200912300341.51287.max@love2party.net>
References:  <200912300341.51287.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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."



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091231012725.GA29194>