This is mostly for my future reference. I’m digging having an entire book, metadata, and cover art in a single big file. But, leaving the conversion up to iTunes hasn’t been working out very well for me, so …
- ffmpeg or faac: Convert from WAV/MP3 to AAC format, then wrap in M4A/M4B MPEG-4 container.
- madplay: Stream MP3 to WAV for faac, if necessary
- tag: Remove ID3 tags.
- vbrfix: Doctor up conjoined MP3 files to fix timing issues.
- mp3wrap: Conjoin MP3 files.
I’m pretty sure that everything on that list works just as well on Mac and Linux.
You do not need both ffmpeg and faac, as ffmpeg has faac built-in. Personally, I think using faac offers more control, but whatever. If you are going to use ffmpeg, then you can probably get away with this:
[code lang=”winbatch”]ffmpeg -i infile.mp3 -sameq outfile.m4a[/code]
That seemed to work, but I honestly didn’t look too hard. Instead, I prefer doing it the more explicit and verbose way with faac:
[code lang=”winbatch”]madplay -m -o wave:- infile.mp3 | faac -b 48 -o outfile.m4b –no-midside -w –artist Artist –title Title –genre Audiobook –album Album –disc “8/13” –year 2009 –cover-art cover.jpg -[/code]
Note the hyphen at the end! It’s there for a reason!
Of course, if you need to conjoin MP3 files into one big file, you need to do that first:
[code lang=”winbatch”]mp3wrap -v outfile.mp3 infiles*.mp3
tag –remove outfile.mp3
vbrfix fromfile.mp3 tofile.mp3[/code]
You can also do this the hard way, with copy /b but you must strip out the tags before you do it:
[code lang=”winbatch”]tag –remove *.mp3
copy /b in01.mp3+in02.mp3 joined.mp3
vbrfix joined.mp3 out.mp3[/code]
If your files are all constant bitrate, then the vbrfix step isn’t necessary … but it won’t try to fix anything if it doesn’t have to, so it’s probably a good habit to get into out of paranoia anyway.
I haven’t figure out how to include chapter/disc breaks into the M4B file yet. That’s my next research project.