Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Aug 2009 03:05:07 +1000 (EST)
From:      Ian Smith <smithi@nimnet.asn.au>
To:        "b. f." <bf1783@googlemail.com>
Cc:        freebsd-multimedia@FreeBSD.org
Subject:   Re: mp3 VBR histogram?
Message-ID:  <20090805235234.H19821@sola.nimnet.asn.au>
In-Reply-To: <d873d5be0908050251u1562609dh595b54e1e47f0137@mail.gmail.com>
References:  <d873d5be0908050251u1562609dh595b54e1e47f0137@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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