All posts
MP3 to AAC via CLI
Encode MP3 to AAC with ffmpeg.
Open online converterPackages to install
Only ffmpeg is required. The built-in aac encoder writes ADTS AAC at a constant bitrate.
ffmpeg
sudo apt-get update
sudo apt-get install -y ffmpegHow to run the command
ffmpeg -i input.mp3 -vn -c:a aac -b:a 192k output.aac. -vn drops album art so the result is audio-only.
ffmpeg -y -i input.mp3 -vn -c:a aac -b:a 192k output.aacDockerfile example
Build a minimal Ubuntu image with the required packages and run the conversion inside the container.
FROM ubuntu:24.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ffmpeg && \
rm -rf /var/lib/apt/lists/*
WORKDIR /work
docker build -t mp3-to-aac .
docker run --rm -v "$PWD:/work" -w /work mp3-to-aac \
ffmpeg -y -i input.mp3 -vn -c:a aac -b:a 192k output.aacExample commands
Run these locally after installing the packages, or inside the container from the Dockerfile.
ffmpeg -y -i input.mp3 -vn -c:a aac -b:a 192k output.aacffmpeg -y -i track.mp3 -vn -c:a aac -b:a 192k -ar 44100 -ac 2 track.aac