FFmpeg Tutorial: How to extract audio from ANY video with FFmpeg
Working on a podcast transcription or AI workflow, well then FFmpeg is the tool
for you.
In this quick tutorial, we're gonna look at how we can extract audio from a
video file
in just one single command.
The audio format and codec can be wave, AEC audio, MP3, anything that you would
like.
Let's get into it.
So of course I have my video here.
Here's how you upload it.
Just a tutorial similar to this one, and let's say I want to transcribe this to
Spanish,
transcribe it to French, any other language.
I would extract it here and set it off to my third party service.
So again, this is using FFmpeg.
I have it installed here.
If you don't have it installed, if you're on Mac, you can simply do brew
install of FFmpeg.
You could also install from source from FFmpeg.org, it's just a little bit more
complicated.
I'm already in this current working directory over here with my video titled
extract_audio,
so FFmpeg-i, which is for input, video.mp4, and q colon a zero.
So this just kind of means the quality of the audio codec, zero, which is just
the highest,
and then we're gonna map just the audio stream.
That's gonna be A.
I'm gonna send it to our folder here as an mp3, all righty, so, there you have
it.
Here's how you upload and playback a video using mux, you can hear it too, so
the reason
why we would do this is just it's super simple, you see it's very quick.
We can also set this to wave, which is kind of an uncompressed audio format, so
we could
also, this way, here's how you upload and playback a video using mux, and then
last one
would be an m4a, which is AAC audio.
So these are all transcoding.
If I wanted to just simply map the output, I could actually see for the audio
codec map
zero, a, oh, I missed copy here, and if I just wanted to do audio, let's say
copy, I know
that it's AAC, so I could put it as an m4a, and this is gonna not transcode,
this will
just stream copy it out, you see it's much quicker, and it's the actual, it's
the same
stream that's in this original file here.
So whether you're saving voiceovers, pulling podcast clips, or repurposing re
els, FFmpeg
gives you full control.
Like this tip?
Subscribe for more bite-sized FFmpeg guides.
Thanks for watching.