LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-03-2006, 10:34 PM   #1
ppk007
LQ Newbie
 
Registered: Feb 2005
Posts: 5

Rep: Reputation: 0
How to access mp3 bitrate info in a shell script?


I have a large collection of mp3 files and they are encoded at various bitrates. I want to sort them into different directory hierarchies based on the bitrate. How can I access the bitrate info from a shell script so that I can do this?

Thanks in advance.
 
Old 08-04-2006, 02:33 AM   #2
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
You can fairly easily just filter the output of a playback program of some sort.

For example, mplayer. If you try the command:

Code:
mplayer filename.mp3 -frames 0 |grep kbit |cut -b 31-35
it should do what you want. Incidentally, it will work for any audio file that mplayer can play, not just mp3.
 
Old 08-04-2006, 03:50 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
And if you find mplayer a wee bit to bulky for just that if you haven't installed it there's always one-purpose tools on Freshmeat and Sourceforge like for instance mp3info.
 
Old 08-04-2006, 05:07 PM   #4
ppk007
LQ Newbie
 
Registered: Feb 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks a million. That helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I find out the bitrate of an mp3? redhatman Linux - Newbie 4 11-22-2013 05:30 PM
Reduce MP3 bitrate lumpfish Linux - Software 5 10-26-2009 05:17 AM
mp3 bitrate converter bird603568 Slackware 10 08-13-2006 10:56 PM
Script to change mp3 icons by bitrate? jms830 Linux - General 1 04-27-2006 02:34 PM
Server info shell script? Rotwang Linux - General 2 10-10-2005 11:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration