---
title: 'Extract Audio from MP4 Video using FFMPEG - Easy'
source: 'https://youtube.com/watch?v=SaJK8bZs0bw'
video_id: 'SaJK8bZs0bw'
date: 2026-06-15
duration_sec: 0
---

# Extract Audio from MP4 Video using FFMPEG - Easy

> Source: [Extract Audio from MP4 Video using FFMPEG - Easy](https://youtube.com/watch?v=SaJK8bZs0bw)

## Summary

This tutorial demonstrates how to extract audio from video files and save it as MP3 using FFmpeg. It covers extracting audio from a single audio track, selecting a specific track from multiple audio streams, and extracting all tracks in one command.

### Key Points

- **Basic audio extraction** [00:00] — Use ffmpeg -i input.mp4 -c:a libmp3lame -q:a 4 output.mp3 to extract audio with variable bitrate.
- **Handling multiple audio tracks** [01:37] — Use ffmpeg -i input.mp4 -c:a libmp3lame -b:a 320k -map 0:2 output.mp3 to select the second audio track (stream index 2).
- **Extracting all audio tracks** [04:36] — Use multiple -map options: ffmpeg -i input.mp4 -map 0:1 -c:a libmp3lame -q:a 4 first.mp3 -map 0:2 -c:a libmp3lame -q:a 4 second.mp3 to extract both tracks in one command.

### Conclusion

FFmpeg provides a simple yet powerful way to extract audio from video files, supporting both single and multiple audio tracks with options for bitrate and quality.

## Transcript

okay so this is how to extract audio
from a video file and save it as an mp3
using ffmpeg so I've got these two video
files here and let's just play waves so
MPV waves so you can see it's got a
single audio track on it and let's just
confirm that with ffmpeg so ffmpeg - I
waves and you can see that it has one
audio stream which is this one here so
in order to extract that and save as an
mp3 all we need to do is type in ffmpeg
- I the name of our video files as waves
and then our audio codec so - see code
on a and we're going to use lib mp3 lame
and now we need to decide whether we
want a constant bitrate file or a
variable bitrate file so in this case
I'm just going to pick variable bitrate
so - Q :
a and let's go somewhere in the middle
of the road so let's pick four and now
all we need to do is provide an output
file name so let's call it waves - sound
dot mp3 and hit enter and we're done so
if we just LS you can see that we now
have an mp3 file and let's just play it
with MPV
so that's the audio extracted from our
waves video file so what if we wanted to
extract an audio track from a video file
that's got multiple audio tracks so I've
got this video cars here so let's play
it so the first track is this weird tune
and the second track is just another
music track so let's quit that and let's
just look at that with ffmpeg so ffmpeg
- I cars so you can see that we have
these two audio streams so all we need
to do is modify our previous command a
tiny bit so that we can select the audio
track that we want to encode so let's
just use ffmpeg to do that so ffmpeg - I
cars and then same set up our audio
codec so - C : a and it's going to be
live mp3 lame and this time we're going
to go for a constant bitrate so - B : a
and let's set it to 320 K which is the
highest that we can set so that's 32
kilobytes per second so now what we need
to do is select one of our audio tracks
so we can do that using map so if we
type in - map and for our second audio
track it would be zero : - now let me
just explain map for a second so this
first number here and by the way all of
these numbers start from zero in their
scale so this first number here
indicates the first file input - ffmpeg
which is this file here if we had have
actually put in another file in fact we
can actually just do that so you can see
so if we just use another - I waves dot
mp4 so now we've got another input file
so if we wanted to select an audio
stream from this input file we would
then set that to one so let's just go to
the end so we'd set that to one and
there is no second audio track within
that file so this wouldn't work
so we'd actually have to set it to one
but let's just change it back to two and
this back to zero so the first number
indicates which file so we're selecting
cars and the second number indicates
which stream so zero in our caused or
mp4 file is actually the video stream
one is our first audio track and two is
our second audio track so we're
selecting the second audio track so all
we need to do now is provide an output
file name so let's just call it cars
- second dot mp3 and let's hit enter
and we're done so if we just LS and
let's play it so NPV cars
- second you can see that it's the
second track play so what if we wanted
to extract both of the audio tracks from
that file and save them into separate
mp3 files well we could actually do that
in just one command line so let's just
remove that file first so RM cars
- second so that's gone now and if we
just modify our previous command so
let's just make some space and get rid
of this because we don't need that
anyway and all we need to do is another
map so - map and it's the first file so
0 : and the first audio stream which is
one in this particular case and just
provide an output file name so let's
call it cars and it's actually the first
audio track so let's just call it first
dot mp3
and that's it so if we just LS now we've
got two new mp3 files and if we play
them so let's MPV cause - first
[Music]
there's the first audio track and let's
just play the second there's the second
audio track and that's all there is to
it so I hope you found that useful if
you did don't forget to subscribe and
thanks for watching goodbye
[Music]
