Extracting Audio with FFmpeg
FFmpeg is the standard tool for extracting audio from video. The most efficient operation: direct extraction without re-encoding (-c:a copy) — instant and lossless.
Direct Extraction (No Re-encoding)
ffmpeg -i video.mp4 -vn -c:a copy audio.aac
ffmpeg -i video.mkv -vn -c:a copy audio.ac3
ffmpeg -i video.webm -vn -c:a copy audio.ogg
# Identify audio codec
ffprobe -v error -select_streams a:0 \
-show_entries stream=codec_name -of default=nw=1 video.mp4
Extract and Convert to MP3
ffmpeg -i video.mp4 -vn -c:a libmp3lame -b:a 192k audio.mp3
ffmpeg -i video.mp4 -vn -c:a libmp3lame -b:a 320k audio_hq.mp3
ffmpeg -i video.mp4 -vn -c:a libmp3lame -q:a 2 audio_vbr.mp3
Extract and Convert to AAC
ffmpeg -i video.mp4 -vn -c:a aac -b:a 128k audio.aac
ffmpeg -i video.mp4 -vn -c:a aac -b:a 256k audio.m4a
Extract to FLAC (Lossless)
ffmpeg -i video.mkv -vn -c:a flac audio.flac
Extract to WAV
ffmpeg -i video.mp4 -vn -c:a pcm_s16le -ar 44100 audio.wav
ffmpeg -i video.mp4 -vn -c:a pcm_s24le audio_24bit.wav
Extract a Time Segment
ffmpeg -i video.mp4 -ss 00:01:30 -to 00:03:00 -vn -c:a libmp3lame -b:a 192k segment.mp3
ffmpeg -i video.mp4 -ss 90 -t 60 -vn -c:a copy segment.aac
Multiple Audio Tracks (MKV)
ffprobe -v error -select_streams a \
-show_entries stream=index,codec_name -of csv video.mkv
ffmpeg -i video.mkv -map 0:a:0 -c:a flac track_1.flac
ffmpeg -i video.mkv -map 0:a:1 -c:a flac track_2.flac
Batch Processing
for f in *.mp4; do
ffmpeg -i "$f" -vn -c:a libmp3lame -b:a 192k "${f%.mp4}.mp3"
done
for f in *.mkv; do
ffmpeg -i "$f" -vn -c:a flac "${f%.mkv}.flac"
done
Recommended Formats
| Use | Format | Command |
|---|---|---|
| Podcast / streaming | MP3 192 kbps | -c:a libmp3lame -b:a 192k |
| Music platforms | AAC 256 kbps | -c:a aac -b:a 256k |
| Professional editing | WAV 24-bit | -c:a pcm_s24le |
| Lossless archive | FLAC | -c:a flac |
Conclusion
FFmpeg extracts audio from any video with a single command. Use -c:a copy for maximum efficiency. For distribution, MP3 at 192 kbps offers the best quality/compatibility balance.
Advanced Use Cases
Beyond casual conversion, modern audio formats cover highly specific professional scenarios. Music production: professional studios work with WAV or FLAC during mastering to avoid cumulative loss between passes — lossless format guarantees every modification is bit-perfect relative to the previous state. Streaming platform distribution: Spotify accepts WAV/FLAC at upload but re-encodes to Ogg Vorbis 320 kbps for Premium and AAC 128 kbps for free users; Apple Music uses AAC 256 kbps VBR; Tidal and Qobuz distribute FLAC for audiophiles. Professional podcasting: Apple Podcasts recommends AAC 128 kbps mono for voice (optimal efficiency); Spotify accepts MP3 192 kbps; master files are saved in WAV for future remasters. Audiobooks: Audible uses AAX (DRM variant of AAC) with variable bitrate by quality. Video games: many engines (Unity, Unreal) prefer OGG Vorbis for its royalty-free status and perfect looping support.
Best Practices and Professional Tips
Archival workflow: always keep a master FLAC or WAV of every important audio file. Lossy formats (MP3, AAC, OGG) are derivatives — you can always generate MP3 from FLAC, but never recover quality lost in the reverse direction. Bitrate selection: for music, MP3 320 kbps or AAC 256 kbps are indistinguishable from lossless on casual equipment; for podcast 96-128 kbps mono is enough. Sample rate: 44.1 kHz is the CD standard for music; 48 kHz for video; 96/192 kHz only adds value in professional production with studio monitoring. Metadata and cover art: always use ID3v2.4 with UTF-8 to ensure special characters (accents, ñ, Chinese symbols) display correctly in any player. Embed cover art at 600×600 px JPEG progressive — universally recognized standard format.
Compatibility and Technical Considerations
KaijuConverter processes audio files on dedicated cloud infrastructure with FFmpeg 6.x as the main engine and the best available codec libraries (LAME 3.100 for MP3, libfdk-aac for AAC, FLAC reference encoder, libopus for Opus). Processing is streaming — we don't wait to receive the full file before starting to process, significantly reducing perceived latency. We support files up to 200 MB with sample rates from 8 kHz to 192 kHz, depths of 16/24/32-bit (including float for professional editing), and configurations from mono to surround 7.1 when the destination format allows. Privacy: files are processed in isolated Docker containers, encrypted in transit with TLS 1.3, and automatically deleted with multi-pass overwrite after 2 hours. DRM: protected files (Apple Music DRM, Audible AAX) cannot be converted — DRM blocks access to the original stream. For those cases, you must obtain a legal DRM-free version before conversion.
Related conversions
Common video conversions that pair well with this guide: