- ffmpeg is a line tool of commands cross-platform capable of converting, trimming and processing virtually any audio format.
- The key parameters for audio are -i, -b:a, -ar, -ac, -ss, -to and -t, which allow you to control the quality, duration and structure of the tracks.
- Using filters such as volume, loudnorm or noisereduction, you can adjust volume, normalize levels and reduce background noise in an advanced way.
- Integrated into scripts, ffmpeg automates bulk conversions and complete sound editing workflows in professional or home environments.

If you work with podcasts, home recordings, videos for social media, or simply want to organize your music library, sooner or later you're going to come across ffmpeg . And, make no mistake, it's not just another tool: it's the "Swiss Army knife" of multimedia conversion and editing from the terminal , capable of converting, trimming, recompressing, and automating almost any task involving audio files.
At first glance, it might seem intimidating, because ffmpeg is entirely command-line operated and full of parameters and options. But once you grasp the basic logic, it becomes addictive: you automate processes, save hours of repetitive work, and achieve highly professional results without opening a cumbersome graphics editor.
What is ffmpeg and why is it so useful for audio?

ffmpeg is an open-source set of tools and libraries designed for recording, converting, processing, and streaming audio and video. It runs from the terminal and has become the engine behind many graphical applications and streaming platforms ; if you prefer a graphical interface, see how to edit and convert videos using VLC.
Its name refers to Fast Forward MPEG , alluding to the group that defined the MPEG standards. Since 2000, when Fabrice Bellard started the project, ffmpeg has grown thanks to a huge community of developers who keep it up to date with new codecs, formats, and filters.
For the world of sound, this translates into being able to work with virtually any audio format ( MP3 , WAV, FLAC, AAC, OGG, M4A, etc.), apply advanced filters (normalization, noise reduction, volume change, effects), automate bulk conversions, and also integrate it into larger scripts or workflows.
Another great advantage is that ffmpeg is cross-platform : it works on GNU/Linux, Windows , macOS, and even Android through apps that use it as their engine. It's not just for Linux geeks: anyone can take advantage of it if they're willing to write a few commands.
Installing ffmpeg on major systems

Installation is quite straightforward and, in many cases, it's already available in your system's official repositories. A single command or a quick download is all it takes to get it up and running.
On Debian/Ubuntu -based systems , for example, the package is usually available directly:
sudo apt-get install ffmpeg
Once it's finished, you can check where it's installed with:
which ffmpeg
If you see something like /usr/bin/ffmpeg , everything is in order. On macOS, the most convenient option is usually Homebrew.
brew install ffmpeg
On Windows you have two common methods: download the binary from the official website and add it to the PATH variable manually, or use a package manager like Chocolatey; and if you're looking to convert audio, see how to convert audio to MP3 in Windows 11.
choco install ffmpeg
The only tricky point in Windows is precisely the PATH. If when you run “ffmpeg” it tells you that the command is not recognized , it's because the path to the folder where ffmpeg.exe is located is not correctly added to the environment variables.
Basic commands and essential syntax for audio

The general structure of ffmpeg, for both audio and video, follows a very simple pattern: input parameters, input file, output parameters, and output file . From there, you chain together options.
A minimal command for working with a sound file usually includes -i to indicate input:
ffmpeg -i entrada.ext salida.ext
If you simply run :
ffmpeg -i audio.mp3
Without specifying an output file, ffmpeg will display very detailed technical information about that file: codec, bitrate, duration, sample rate, channels, etc. It's the fastest way to inspect an audio file. If you detect playback or file problems, see how to repair corrupted audio files in Windows.
When you run any command, ffmpeg usually prints a fairly long header to the screen with versions, libraries, and build configuration. If you don't want to see it every time, use the `-hide_banner` option to clean up the output.
ffmpeg -hide_banner -i audio.mp3
Some very useful global parameters to help you navigate the world of ffmpeg are:
- -formats: lists all supported container formats (audio, video, etc.).
- -codecs: displays all available codecs.
- -decoders: codecs that ffmpeg can use as input.
- -encoders: codecs that ffmpeg can use as output.
These lists are long, but they give you an idea of the sheer number of formats and codecs you can work with, especially in audio.
Converting between audio formats with ffmpeg
One of the most common uses of ffmpeg is converting between audio formats , whether to save space, gain compatibility with a device, or prepare files for a specific workflow.
The basic conversion between two formats is as simple as :
ffmpeg -i entrada.mp3 salida.wav
With this command, ffmpeg automatically detects the codec of the source file and the appropriate one for the destination format. But with audio, you'll usually want to have more control over the parameters , especially the quality (bitrate), sample rate, and number of channels.
Some very typical practical examples are:
- MP3 to WAV (for example, to edit without loss in a DAW):
ffmpeg -i input.mp3 output.wav - WAV to MP3 with quality control:
ffmpeg -i input.wav -vn -ar 44100 -ac 2 -b:a 192k output.mp3 - FLAC to MP3 high quality:
ffmpeg -i input.flac -ab 320k output.mp3 - AAC to MP3:
ffmpeg -i input.aac -b:a 192k output.mp3
These commands include several key audio options :
- -vn: indicates that no video should be included in the output, very useful when your source is a container that can hold an image.
- -With: sampling frequency (for example, 44100 Hz).
- -ac: number of channels (1 for mono, 2 for stereo, etc.).
- -b:a o -ab: audio bitrate, which directly controls the quality and size of the file.
The good thing is that these parameters can be mixed according to your needs : lower the quality to reduce size, go from mono to stereo, homogenize all your tracks to 44,1 kHz, etc.
Bitrate and audio quality control
Although ffmpeg tries to maintain consistent quality when converting, sometimes it's advisable to explicitly set the output bitrate to avoid excessively large or poor quality audio files.
ffmpeg -i original.wav -b:a 192k destino.mp3
Typical bitrate values commonly used in compressed audio are:
- 128 kbps: acceptable quality for voice and podcasts.
- 192 kbps: good balance between size and quality.
- 256-320kbps: high margins, interesting for music.
When working with video and you want to control the audio as well, you combine -b:a and -b:v (the latter for the video). For example:
ffmpeg -i video.avi -b:v 2500k -b:a 192k video_final.mp4
Here you are telling ffmpeg to maintain 2.500 kb/s of video and 192 kb/s of audio , which gives a fairly reasonable result for many common uses (home recordings, online classes, etc.).
Cut, trim, and join audio fragments
Another common task when working with audio files is to isolate a specific section of a long recording: removing intros, commercials, silences, or unwanted parts. ffmpeg allows you to do this with second-level precision (or less) using -ss , -to, and -t.
Two very clear examples would be:
ffmpeg -i audio.mp3 -ss 00:00:30 -t 00:01:00 recorte.mp3
In this case, one minute of audio is extracted starting at the 30-second mark of the original track. Another option is to directly specify the endpoint:
ffmpeg -i audio.mp3 -ss 00:00:30 -to 00:01:30 recorte.mp3
Here you're requesting the audio from second 30 to minute 1.5 . The options are interpreted as follows:
- -H.H: starting point of the fragment.
- -to: moment of the end of the fragment.
- -t: duration of the fragment.
If you combine them correctly, you can automate mass cuts or prepare clips for social media, podcasts, or intros without having to open a graphics editor.
A typical advanced case consists of cutting audio from a video without recompressing the rest of the file, simply by copying codecs:
ffmpeg -i input.mp4 -ss 00:01:30 -t 00:00:30 -c:v copy -c:a copy salida.mp4
Here you are cutting out a 30-second fragment of the video while keeping the audio and video as is, making the process very fast and with no additional loss of quality.
Audio processing: volume, normalization, and noise reduction
Beyond cutting and converting, ffmpeg incorporates a good arsenal of audio filters to process sound: raise or lower volume, normalize levels, cut annoying frequencies, reduce background noise and much more.
For simple volume changes, the most direct filter is volume via -filter:a :
ffmpeg -i input.mp3 -filter:a "volume=2.0" output.mp3
This doubles the volume (equivalent to an increase of about 6 dB). You could also use values like 0.5 to reduce it by half, or express it in decibels: volume=3dB, For example.
Another older, but still present, option is -vol , which works with an approximate range of 0-256, where 256 would be the original volume:
ffmpeg -i INPUT_AUDIO.mp3 -vol 200 OUTPUT_AUDIO.mp3
If you want to equalize the levels of several tracks (for example, podcast episodes with irregular volumes), you'll be interested in the loudnorm filter , which implements normalization according to the EBU R128 standard:
ffmpeg -i input_audio.mp3 -af loudnorm output_audio.mp3
This option analyzes the perceived loudness and adjusts the volume while maintaining the dynamic range quite respectfully, resulting in a more homogeneous listening experience and less fatigue.
To combat background noise (buzz, hiss, etc.), ffmpeg allows you to chain filters together, for example:
ffmpeg -i input_audio.mp3 -af "highpass=f=200, lowpass=f=3000, noisereduction=p=0.05:s=0" output_audio.mp3
Here you're applying a high-pass filter at 200 Hz, a low-pass filter at 3 kHz, and then a noise reduction filter . The values should be adjusted according to the type of noise and the content (voice, music, ambient sound), but this serves as a basis for cleaning up home recordings.
Extracting and replacing audio in video files
Another area where ffmpeg shines is in the interaction between audio and video . Two very common operations are extracting audio from a video and replacing the soundtrack with a new one.
ffmpeg -i input.mp4 -vn -c:a mp3 -b:a 128k salida.mp3
The -vn parameter discards any video, and -c:a mp3 tells you to encode the audio to MP3 at the desired bitrate. Ideal for extracting audio from lectures, online classes, or video podcasts (see converting MP4 to MP3 in Windows 11 ).
If you want the exact opposite, that is, to keep the video but change the audio , you can combine the streams with -map :
ffmpeg -i INPUT_VIDEO.mp4 -i NEW_AUDIO.mp3 -map 0:v -map 1:a -c copy OUTPUT_VIDEO.mp4
This tells ffmpeg to use the video from the first file (index 0:v) and the audio from the second (1:a), copying the codecs exactly as they are if compatible. It's a perfect way to correct faulty audio, dub a video, or reuse the same visual montage with multiple soundtracks.
Automating audio tasks with scripts
The true power of ffmpeg becomes apparent when you integrate it into scripts and automate repetitive tasks . For example, if you convert dozens of WAV files to FLAC or MP3 every week, doing it manually with drag and drop becomes a real chore; with a small shell or Windows script , it's reduced to running a single file.
In Windows, it's very common to create a .bat file that iterates through all the files in a directory and converts them into a block. A typical scheme might look like this:
:: Script para convertir WAV a FLAC
if not exist entrada mkdir entrada
if not exist salida mkdir salida
for %%a in ("entrada\*.wav") do ffmpeg -y -i "%%a" -vn -c:a flac "salida\%%~na.flac"
@echo off
pause
The first time you run it, it will create input and output folders . From then on, simply place the WAV files in the input folder and run the script again. By changing the extensions in the relevant lines, you can adapt it to virtually any combination of formats.
In GNU/Linux or macOS environments, the idea is the same but with bash scripts and loops foror even integrating ffmpeg into more elaborate scripts with YAML, where you define a list of tracks, cuts, volumes, etc., and the script takes care of calling ffmpeg with all the appropriate parameters.
Visualizing audio: waveforms and spectra in video
Although the focus of this tutorial is audio, you may often be interested in converting a sound file into a video with a waveform or some similar visualization, especially for uploading audio content to platforms that require video (YouTube, for example).
ffmpeg -i INPUT_AUDIO.aac -filter_complex "showwaves=mode=cline:s=1920x1080:colors=white" -map "" -map 0:a -c:a copy -pix_fmt yuv420p OUTPUT_VIDEO.mp4
This command creates a Full HD video with a white waveform , preserving the original audio without recompressing it. Perfect for publishing podcasts or music tracks on video platforms without the hassle of graphic editors.
You can also generate videos from still images to accompany audio, creating the typical cover art that plays in the background while the song plays. A simple example would be:
ffmpeg -loop 1 -i imagen.png -i audio.mp3 -c:v libx264 -t 300 -pix_fmt yuv420p video.mp4
The -loop 1 option makes the image repeat, -t sets the duration (in this example, 300 seconds), and the result is a video that is perfectly valid for any player or platform.
Integrating ffmpeg into more complex workflows
In larger projects, ffmpeg is usually just one piece of an automation workflow . For example, you might have bash or Python scripts that read a YAML file containing the complete assembly definition: which audio tracks to use, which sections to cut, how to adjust volumes, what resolution to use if there's video, and so on.
In this type of setup, ffmpeg is responsible for:
- Automatically crop the audio segments you need (intros, interviews, jingles, outros).
- adjust volumes of each block so that there is sound coherence.
- Standardize technical parameters such as sampling frequency, output format, bitrate, etc.
- Concatenate all in a final file ready for publication.
Furthermore, you can add smooth audio transitions with filters like acrossfade , creating fades between segments without having to use a multitrack editor. This is especially powerful in contexts such as online courses, interview series, or podcasts with a fixed structure, where standardization and repeatability are invaluable.
Once you get the hang of this way of working, ffmpeg goes from being "a weird command" to a central piece in your audio production toolbox: it reliably converts, cleans, adjusts, and packages your tracks , and adapts equally well to one-off tasks as to super-structured pipelines controlled by scripts or configuration files.
With all that said, it's clear that ffmpeg is not just a format converter, but a true audio and video processing engine that, when used wisely, allows you to automate everything from simply converting a batch of MP3s to complete multimedia editing and publishing workflows, always maintaining fine control over the quality, duration, and final result of your sound files.
Table of Contents
- 1 What is ffmpeg and why is it so useful for audio?
- 2 Installing ffmpeg on major systems
- 3 Basic commands and essential syntax for audio
- 4 Converting between audio formats with ffmpeg
- 5 Bitrate and audio quality control
- 6 Cut, trim, and join audio fragments
- 7 Audio processing: volume, normalization, and noise reduction
- 8 Extracting and replacing audio in video files
- 9 Automating audio tasks with scripts
- 10 Visualizing audio: waveforms and spectra in video
- 11 Integrating ffmpeg into more complex workflows