How to Compress an Audio File using FFmpeg

Casper Kloppenburg·28 October 2022·1 min read

Prerequisites

FFmpeg is a free and open-source video editing tool capable of trimming, cropping, concatenating, muxing, and transcoding almost any type of media file you throw at it.

It's also a very robust solution for implementing video automation, as we use it extensively in our own video editing API. For this tutorial we'll use FFmpeg 5.1.2, but any recent version will do.

Compressing an audio file

An audio file can be encoded at a lower bit rate in order to reduce its file size:

$ ffmpeg -i input.mp3 -b:a 128k output.mp3 Specify a bitrate using the -b:a argument, such as:

  • 96k
  • 112k
  • 128k
  • 160k
  • 192k
  • 256k
  • 320k

Start automating today

Start for free →
  • Every feature included
  • 50 free credits
  • No credit card required