Tool
The tool reads the audio codec from a video file (or from ffprobe output) and tells you which extensions you can extract to as-is, without re-encoding, along with the FFmpeg command. If the extension you want can’t be copied into, it shows the command for re-encoding to mp3, m4a or opus and a file size calculation by bitrate. The file is read only inside this browser.
1. Tell the tool the source audio codec (any one of three ways)
2. Selected source: AAC
AAC — extensions you can copy it into without re-encoding
.m4a · .aac · .mka (anything)
Lossless is possible: .m4a with -c:a copy
The sound isn't rebuilt. The stream is just pulled out and wrapped, so quality stays identical and it finishes almost instantly. An MP4-family audio file. The standard extension for AAC.
FFmpeg command
ffmpeg -i "input.mp4" -map 0:a:0 -c:a copy "input.m4a"
-map 0:a:0 is audio stream number 1 in the file. The original is left untouched and input.m4a is created as a new file.
Size calculation (bitrate × length, not measured)
| Case | Bitrate | Size |
|---|---|---|
| Copy (as-is) | Unknown | – |
| Re-encode to AAC (.m4a) | 96 kbps | 43.2 MB |
| Re-encode to AAC (.m4a) | 128 kbps | 57.6 MB |
| Re-encode to AAC (.m4a) | 192 kbps | 86.4 MB |
| Re-encode to AAC (.m4a) | 256 kbps | 115.2 MB |
| Re-encode to AAC (.m4a) | 320 kbps | 144.0 MB |
At the same bitrate the size is the same for any codec (1 MB = 10^6 bytes, container headers excluded). Which codec sounds better at the same size is something this site has not measured. If you choose a file directly, the average bitrate is calculated and shown for MP4 and MOV.
Extensions like .mp3, .m4a and .opus are file formats that hold sound, while AAC, Opus and AC-3 are the compression methods (codecs) that go inside them. If the audio in your video is AAC, you can pull that stream out unchanged and wrap it in an .m4a file. But an MP3 file is a format for MP3-compressed data, so putting the name .mp3 on a file that holds AAC data doesn’t give you a valid MP3. Some players look at the content instead of the extension and play it anyway, but that is luck, not a guarantee.
So there is an order to follow. (1) Check the source codec → (2) copy with -c:a copy into an extension that codec fits → (3) re-encode only when you really need a different format. Copying doesn’t rebuild the sound, so quality stays identical and it takes almost no time.
.m4a (or raw .aac). ALAC (Apple Lossless) also fits in .m4a..mp3. Opus → .opus or .ogg. Vorbis → .ogg..ac3, E-AC-3 → .eac3, FLAC → .flac, PCM → .wav, DTS → .dts, TrueHD → .thd..mka (Matroska audio), which makes it the safest copy destination if the extension doesn’t matter to you. Some devices and apps can’t play .mka, though.libmp3lame), AAC (aac) and Opus (libopus).-map 0:a:N selects the Nth audio stream in the file, counting from 0. In a video with several languages or commentary tracks, this is how you pick the sound you want.-b:a 192k is the target bitrate. File size is roughly bitrate × length ÷ 8, and the table is exactly that arithmetic. If you encode with variable bitrate (VBR), the real size will differ.-ac 2 to the command to downmix to stereo.Audio: line from the output of ffprobe -hide_banner video.mp4. If you already know the codec, pick it from the list.If you want to move the whole video into a different container, there is the MKV to MP4 Remux Feasibility Checker, and you can see which tracks a file holds besides audio with the Video File Info Inspector. If a command gives an error, try the FFmpeg Error Log Explainer. To see whether libmp3lame and libopus are in your FFmpeg, paste your output into the FFmpeg Build Capability Checker (that tool focuses on video encoders, so you can also look for them directly in the output of ffmpeg -encoders).