From owner-freebsd-multimedia@FreeBSD.ORG Thu Dec 31 02:04:52 2009 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14C20106568F for ; Thu, 31 Dec 2009 02:04:52 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.freebsd.org (Postfix) with ESMTP id D31138FC14 for ; Thu, 31 Dec 2009 02:04:51 +0000 (UTC) Received: from hydrogen.funkthat.com (bshcyzpul86zn7cc@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id nBV1RV2E009642; Wed, 30 Dec 2009 17:27:31 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id nBV1RPhH009636; Wed, 30 Dec 2009 17:27:25 -0800 (PST) (envelope-from jmg) Date: Wed, 30 Dec 2009 17:27:25 -0800 From: John-Mark Gurney To: Max Laier Message-ID: <20091231012725.GA29194@funkthat.com> Mail-Followup-To: Max Laier , freebsd-multimedia@freebsd.org References: <200912300341.51287.max@love2party.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200912300341.51287.max@love2party.net> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (hydrogen.funkthat.com [127.0.0.1]); Wed, 30 Dec 2009 17:27:31 -0800 (PST) Cc: freebsd-multimedia@freebsd.org Subject: Re: WIP: DVB-C support X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 02:04:52 -0000 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."