FFmpeg Audio Processing Extracting Audio from Video

Extracting Audio from Video

AS
Isabella
| Jan 21, 2025 |
4 min read
#audio #extraction

If you want to save the soundtrack of a movie or a music video as an MP3 or WAV file, FFmpeg makes it simple to “remove the video” from the audio.

Basic Extraction (MP3)

ffmpeg -i input.mp4 -vn -q:a 2 output.mp3
  • -vn: Video No. Disables video recording.
  • -q:a 2: Sets the audio quality for variable bit rate (0-9, where 0 is best). 2 is a standard high-quality setting.

Extracting Original Format

If you want to extract the audio exactly as it exists inside the container (e.g., AAC) without re-encoding:

ffmpeg -i input.mp4 -vn -acodec copy output.aac

This is instantaneous and lossless compared to the source.