How to Extract Audio from MKV Files Using FFmpeg
I have mentoring session today and it was fire!
Student went from "I can't code" to landing their first tech job. Recorded everything in MKV, but now I need to extract all the gold nuggets of advice. Let me show you my process, starting with audio extraction.
First things first, you'll need:
- FFmpeg installed (don't worry, it's not as scary as it sounds)
- Your MKV recording (mine's from OBS)
The Simple Way:
Look, I know some tutorials make this super complicated. But here's the command I use every time:
ffmpeg -i input.mkv -vn -acodec mp3 output.mp3
That's it. Seriously. But let me break it down:
input.mkv
= your recording file-vn
= ignore the video (we just want the audio)-acodec mp3
= make it MP3output.mp3
= your new audio file
Dealing With Spaces
My recording was actually named "Mentoring Session - Junior Dev Journey.mkv" - yeah, with spaces.
Here's how to handle that:
ffmpeg -i "Mentoring Session - Junior Dev Journey.mkv" -vn -acodec mp3 "Audio - Junior Dev Journey.mp3"
Pro Tips From Someone Who Does This A Lot:
- Want Better Quality?
Sometimes you need crystal clear audio for transcription. Add this:
ffmpeg -i "Mentoring Session.mkv" -vn -acodec mp3 -q:a 2 "Audio.mp3"
The -q:a 2
part makes it high quality. You can use 0-9
(lower = better). I stick with 2 because it's good enough for transcription services.
- Keep Original Quality If you're picky about audio quality (like me when recording coding tutorials):
ffmpeg -i input.mkv -vn -acodec copy output.aac
- Check What You're Working With
Not sure about your audio tracks? Run this:
ffmpeg -i input.mkv
This saved me many times when dealing with multi-language recordings.
Why This Matters?
Look, recording mentoring sessions is great, but the real value comes from making that content accessible. I use the MP3 output for:
- Getting transcriptions for non-native English speakers
- Extracting action items for follow-ups
- Creating summaries for my community
- Finding stories to share (like this one!)