FFmpeg Tutorial: How to extract audio from ANY video with FFmpeg

0:00

Working on a podcast transcription or AI workflow, well then FFmpeg is the tool

0:05

for you.

0:06

In this quick tutorial, we're gonna look at how we can extract audio from a

0:09

video file

0:10

in just one single command.

0:12

The audio format and codec can be wave, AEC audio, MP3, anything that you would

0:17

like.

0:18

Let's get into it.

0:20

So of course I have my video here.

0:22

Here's how you upload it.

0:23

Just a tutorial similar to this one, and let's say I want to transcribe this to

0:28

Spanish,

0:29

transcribe it to French, any other language.

0:31

I would extract it here and set it off to my third party service.

0:35

So again, this is using FFmpeg.

0:38

I have it installed here.

0:40

If you don't have it installed, if you're on Mac, you can simply do brew

0:43

install of FFmpeg.

0:44

You could also install from source from FFmpeg.org, it's just a little bit more

0:49

complicated.

0:50

I'm already in this current working directory over here with my video titled

0:56

extract_audio,

0:57

so FFmpeg-i, which is for input, video.mp4, and q colon a zero.

1:07

So this just kind of means the quality of the audio codec, zero, which is just

1:12

the highest,

1:13

and then we're gonna map just the audio stream.

1:17

That's gonna be A.

1:18

I'm gonna send it to our folder here as an mp3, all righty, so, there you have

1:27

it.

1:29

Here's how you upload and playback a video using mux, you can hear it too, so

1:33

the reason

1:33

why we would do this is just it's super simple, you see it's very quick.

1:38

We can also set this to wave, which is kind of an uncompressed audio format, so

1:45

we could

1:46

also, this way, here's how you upload and playback a video using mux, and then

1:52

last one

1:53

would be an m4a, which is AAC audio.

2:00

So these are all transcoding.

2:02

If I wanted to just simply map the output, I could actually see for the audio

2:07

codec map

2:09

zero, a, oh, I missed copy here, and if I just wanted to do audio, let's say

2:17

copy, I know

2:19

that it's AAC, so I could put it as an m4a, and this is gonna not transcode,

2:24

this will

2:24

just stream copy it out, you see it's much quicker, and it's the actual, it's

2:31

the same

2:31

stream that's in this original file here.

2:34

So whether you're saving voiceovers, pulling podcast clips, or repurposing re

2:41

els, FFmpeg

2:42

gives you full control.

2:44

Like this tip?

2:45

Subscribe for more bite-sized FFmpeg guides.

2:48

Thanks for watching.