- ffmpeg
- cygwin (on windows)
cd /path/to/m4a/files
mkdir out
for f in *.m4a; do
ffmpeg -i "$f" -ab `ffmpeg -i "$f" 2>&1 | grep Audio | awk -F', ' '{print $5}' | cut -d' ' -f1`k -map_metadata 0 -id3v2_version 3 -write_id3v1 1 "out/${f%%.*}.mp3"
done
http://blog.kdecherf.com/2012/01/14/ffmpeg-converting-m4a-files-to-mp3-with-the-same-bitrate http://jonhall.info/tips_and_tricks/id3_tags_on_windows_using_ffmpeg
This command assumes there are no periods (.) in the filenames other than for the extension. Bad assumpition!
Replace:
"out/${f%%.*}.mp3"
with
"out/${f%.*m4a}.mp3"