On Wed, Jun 27, 2012 at 11:58:50AM +0100, Jon Dowland wrote: > I'm browsing through some VBR MP3s encoded with lame --preset standard. > tagtool is telling me they're 128kbps bit rate, but they are not.
OK, this is an interesting one. I don't think any id3 library will be able to reliably report a bitrate, because it could simply mismatch with the file. I hacked in support to use libmad to figure it out, which was accurate but too slow (needed to decode every frame and cumulative average the frame's rates). The fastest method would be if you could reliably determine the playback length, how many bytes are in the layer 3 segment of the file and then do the arithmetic. It might be possible to expand/correct the parts of mpeg_file.c that do this (read_header, which relies on lookup_bit_rate, which relies on the MPEG header and seems to assume CBR). However this is all a many-times-over solved problem, and perhaps linking in gstreamer and using GstDiscoverer would just re-use an excellently-implemented existing solution. -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

