From owner-freebsd-multimedia@FreeBSD.ORG Wed Aug 5 17:05:16 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 48C141065670 for ; Wed, 5 Aug 2009 17:05:16 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [220.233.188.227]) by mx1.freebsd.org (Postfix) with ESMTP id B6E618FC15 for ; Wed, 5 Aug 2009 17:05:15 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id n75H5Aou001644; Thu, 6 Aug 2009 03:05:12 +1000 (EST) (envelope-from smithi@nimnet.asn.au) Date: Thu, 6 Aug 2009 03:05:07 +1000 (EST) From: Ian Smith To: "b. f." In-Reply-To: Message-ID: <20090805235234.H19821@sola.nimnet.asn.au> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-multimedia@FreeBSD.org Subject: Re: mp3 VBR histogram? 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: Wed, 05 Aug 2009 17:05:16 -0000 On Wed, 5 Aug 2009, b. f. wrote: > >does anyone know anything that can produce the sort of ASCII histogram > >that lame produces while encoding in VBR, from an existing .mp3 file? > > > >I'm interested in analysing the bitrate distribution of frames of a VBR > >live stream, though I don't mind saving it to a disk file if necessary. > > Any application that can sweep through an mp3 and read the frame > headers should have code that you can adapt for this purpose, and > there are many such pieces of software in Ports (every mp3 decoder, > and many utilities). If you want something ready-made, and efficiency > isn't of paramount importance, you could use, for example, > audio/mp3plot or audio/mp3stat on files. > > I've dumped frame bitrates of mp3 files before from the command-line > using audio/mp3_check and something like: > > mp3_check -avv sample.mp3 | awk '/BitRate/ { print $2 }' - 192 160 160 320 96 160 112 160 128 160 128 160 160 224 That works well for extracting the raw frame bitrates, might try scripting up a simple histogram from that, the next rainy day. > audio/py-mad, a python interface to audio/libmad, has some example > code for reading mp3 streams, and could also be used for this purpose. Thanks for the good clues. Speed's not an issue; more about occasional sampling than realtime monitoring. mp3plot looks good on spec, still building; compiling boost very nearly ran this old laptop out of swap! cheers, Ian