Freeing Audible files with ffmpeg and mp4box

Install dependencies:

apt-get install git python-requests python-selenium gpac

Get tool to acquire our activation bytes. These bytes will allow ffmpeg to decrypt the Audible aax files.

git clone
cd audible-activator

Install a version of ffmpeg that supports the new feature -activation_bytes

mkdir /usr/local/ffmpeg
wget -O - | tar Jxf -
mv ffmpeg-3.0-64bit-static/* /usr/local/ffmpeg/
for m in ffmpeg ffmpeg-10bit ffprobe ffserver qt-faststart; do ln -s /usr/local/ffmpeg/$m /usr/local/bin/$m; done



Audible aax files are encoded with aac so you can do the following to copy the stream out of the aax into an mpeg4 container.

ffmpeg -activation_bytes ${ACTIVATION_BYTES} -i input.aax -vn -c:a copy output.m4a

Unfortunately, this will not copy the album art along with the file. So we have to something like this:

Save the cover to a jpeg file

ffmpeg -activation_bytes ${ACTIVATION_BYTES} -i ${m} -an -vcodec copy cover.jpg

Actually do the stream copy using the audio stream only.

ffmpeg -activation_bytes ${ACTIVATION_BYTES} -i ${m} -vn -c:a copy output.m4a

Use the jpeg we created earlier and drop it into the converted file.

MP4Box -itags cover=cover.jpg output.m4a