The Only FFmpeg Command You Need to Convert WAV to MP3

You need to convert a WAV file to an MP3. This is a common task. WAV files are uncompressed, they take up too much space. MP3s give you compression, smaller files, and wider compatibility. This is why you convert.

The tool you need is ffmpeg. It handles virtually all your audio and video conversion needs.

First, ensure you have ffmpeg installed on your Ubuntu system. If not:

sudo apt update
sudo apt install ffmpeg

Once ffmpeg is ready, the command to convert your WAV file to an MP3 is straightforward. You want to control the quality. For a good balance of quality and file size, use a variable bitrate (VBR) setting.

Here is the command:

ffmpeg -i your_input_file.wav -q:a 2 your_output_file.mp3

Let’s break that down:

  • -i your_input_file.wav: This specifies your input file. Replace your_input_file.wav with the actual path and name of your WAV file.
  • -q:a 2: This sets the audio quality. For MP3, q:a controls the quality level. Lower numbers mean higher quality and larger file sizes. is the highest quality, 9 is the lowest. A value of 2 typically provides excellent quality without an excessive file size.
  • your_output_file.mp3: This is the name and path for your new MP3 file. Replace your_output_file.mp3 with your desired output.

Execute that command. Your MP3 will be generated. Don’t overthink simple problems.