LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-19-2006, 10:03 PM   #1
webvolutionary
LQ Newbie
 
Registered: Nov 2006
Posts: 2

Rep: Reputation: 0
m4a convert - rename script


I have a collection of aac files in a folder and would like to convert them all to mp3 format. My collection is in folders as such: /music/artist/album/01 title.m4a (01 being the track number). I would like to convert all the files and rename them to include the artist and album info but I am at a loss as to how to do this.

Googling turned up the following to convert the files:

Code:
$ ffmpeg -i input.m4a -acodec mp3 -ac 2 -ab 128 output.mp3
But I would have to go into each directory and run this and it still dosen't solve my renaming problems. Anyone have any ideas?
 
Old 11-21-2006, 07:49 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
First BACKUP.
Code:
cd /music
find . -type f -name \*.m4a |while read infile; do
  ffmpeg -i "$in" -acodec mp3 -ac 2 -ab 128 "${in%.m4u}.mp3"
done
Check that mp3 files were generated correctly before deleting:
Code:
find . -type f -iname \*.m4a |while read infile; do
  rm -f "$in"
done
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rename script superior888 Programming 2 07-31-2006 11:53 AM
Making shell script to 'locate' m4a files and delete them bd1308 Linux - Software 3 02-12-2006 10:44 AM
Help with script to rename shilo Slackware 10 02-04-2006 08:58 AM
File rename script jjwl89 Linux - General 1 03-14-2005 06:28 PM
Need script to rename files joe_stevensen Programming 5 12-05-2003 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:38 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