Linux command line utility to determine mp3 bitrate?

23

3

Is there a command-line utility to determine the bitrate of an mp3 file?

chris

Posted 2009-09-07T01:20:58.237

Reputation: 8 607

Answers

26

You can get all ID3 meta-tags including the bitrate from exiftool:

ExifTool is free software used for reading, writing, and manipulating image, audio and video metadata. It is platform independent and is both a Perl library and command-line application. ExifTool is a popular tool to incorporate into different types of digital workflows and supports many types of metadata including Exif, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as manufacturer-specific metadata of many digital cameras.

Starting with version 7.79 (June 20, 2009), ExifTool added read/write support for Adobe InDesign files (.IND, .INDD, .INDT), and ability to geotag with KML files.

The command you want is:

$ exiftool -AudioBitrate File.mp3
Audio Bitrate : 128000

Running the command without any arguments gets you all the tags. It is cross-platform, and works for most multimedia types. This is available via the libimage-exiftool-perl package on Ubuntu.

user4358

Posted 2009-09-07T01:20:58.237

Reputation:

This also looks useful, and I'll give it a try. Thanks. – chris – 2009-09-07T02:15:48.693

22

file is able to identify the bitrate of MP3s, and is probably already installed on your machine, even if your distro is one of those that avoids installing an MP3 decoder.

Chris R. Donnelly

Posted 2009-09-07T01:20:58.237

Reputation: 321

8

mpg321 should display this info when the -t switch is used. It is actually a command-line player, but -t should give you what you want.

MDMarra

Posted 2009-09-07T01:20:58.237

Reputation: 19 580

1

I know this is 5 years old, but Google finds it, and it's excellent advice.

exiftool -AudioBitrate File.mp3 

gives much better information in an easier-to-read format. e.g.:

======== 15-Is This Thing On .mp3
Audio Bitrate                   : 320 kbps
======== 16-Run.mp3
Audio Bitrate                   : 320 kbps
======== 17-Good Old Days.mp3
Audio Bitrate                   : 320 kbps

Biffster

Posted 2009-09-07T01:20:58.237

Reputation: 11

6

...true, but isn't this already mentioned in nagul's answer? (Please see http://superuser.com/about if you figured this is a "regular forum".)

– Arjan – 2014-02-17T18:29:47.380