Let's say you have a load of purchased m4a files which you would like to transfer to a flash drive and in turn plug into a TV or other media center. Unfortunately the media center only takes MP3s. What to do?
Convert them in a few easy steps. (FREE)
Step 1: Requirements
MP3 encoder. (http://lame.sourceforge.net/)
A few notes:
I'm doing this in Windows. The *nix version should be very similar and actually a bit easier in one of the steps.
Install all of the above where you see fit. Then run the following command in a command prompt to check that ffmpeg recognizes the mp3 encoder.
ffmpeg -codecs help
ffmpeg -codecs help | grep 'mp3'
Check for libmp3lame as in the attached image. If it is there, then you are good to go.
Step 2: The Batch Script
I'll discuss two methods and you can choose which one to use. Add the script content of the option you would like to use.
Convert single file to mp3:
This option will take one file as an argument and convert it to an mp3 and save it as the original file name appended with a '.mp3'
set filename=%1 C:\Path_to_ffmpeg\ffmpeg.exe -i %filename% -acodec libmp3lame -ab 128k %filename%.mp3 PAUSE
Convert a batch of arguments (not checked for type) to mp3.
Loops through the batch file arguments and tries to convert them all.
setlocal enabledelayedexpansion set argCount=0 for %%x in (%*) do ( set /A argCount+=1 set "argVec[!argCount!]=%%~x" ) echo Number of processed arguments: %argCount% for /L %%i in (1,1,%argCount%) do C:\Path_to_ffmpeg\ffmpeg.exe -i "!argVec[%%i]!" -acodec libmp3lame -ab 128k "!argVec[%%i]!".mp3 PAUSE
I've created two batch files as can be seen in the attached image, one for each script, but only one is required.
Step 3: Drag and Drop
The last step:
Open two Explorer sessions. The first navigated to the directory where ffmpeg and the batch scripts are stored. The other to the M4As you wish to convert.
Select the M4A files, drag and drop them on the batch script created in the previous step. The process should start automatically and spit out MP3 files in the same directory as the M4A files.
Step 4: Some Final Notes
This process does not support directories. Only files. There is probably some snazzy way of going through all the sub directories and get the m4a files. But I've not needed it.
There are tools out there with nifty GUIs to do this. This one is free.
Lastly, FFMPEG does not grab cover art and album information. It purely converts one file format to another through encoding. If there is a way (using ffmpeg) to do so, then let me know since it will be pretty cool.