Tool

Extract Audio From Video: Can You Copy It? Extension and Command Picker

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)

CaseBitrateSize
Copy (as-is)Unknown–
Re-encode to AAC (.m4a)96 kbps43.2 MB
Re-encode to AAC (.m4a)128 kbps57.6 MB
Re-encode to AAC (.m4a)192 kbps86.4 MB
Re-encode to AAC (.m4a)256 kbps115.2 MB
Re-encode to AAC (.m4a)320 kbps144.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.

Why you can’t just rename the file to .mp3

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.

How the verdict is decided

  • AAC → .m4a (or raw .aac). ALAC (Apple Lossless) also fits in .m4a.
  • MP3 → .mp3. Opus → .opus or .ogg. Vorbis → .ogg.
  • AC-3 → .ac3, E-AC-3 → .eac3, FLAC → .flac, PCM → .wav, DTS → .dts, TrueHD → .thd.
  • Any codec is known to fit in .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.
  • Anything else means re-encoding. The targets this tool builds commands for are three: MP3 (libmp3lame), AAC (aac) and Opus (libopus).

How to read the re-encode command and the size table

  • -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.
  • MP3 holds at most 2 channels, so if the source is multichannel such as 5.1, add -ac 2 to the command to downmix to stereo.
  • Lossy compression (AAC, MP3, Opus, AC-3 and so on) re-compressed with lossy compression stacks the loss. Setting a bitrate higher than the source doesn’t bring back information that was already thrown away; it only makes the file bigger. The tool shows a warning in that case.

How to use it

  1. Choose a video file, or paste the Audio: line from the output of ffprobe -hide_banner video.mp4. If you already know the codec, pick it from the list.
  2. Check the extensions that the verdict at the top marks as lossless. If one suits your purpose, copy into that extension.
  3. Copy the re-encode command only when you need mp3 specifically (an old device, an upload requirement and so on), and pick the bitrate by looking at the size table.
  4. Play the file you made and check the sound and the length.

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).

Limitations worth knowing

  • The verdict is based on codec names and extension rules. Even with the same codec, unusual settings (for example some multichannel layouts or non-standard profiles) can make a copy fail.
  • If you choose a file directly, only the headers of MP4, MOV, MKV and WebM are read. Formats such as AVI, TS and FLV can’t be read, so paste the ffprobe output or pick the codec yourself.
  • The bitrate and size table is arithmetic and not a quality measurement. This site’s measurements focus on video (VMAF), and audio quality (listening tests and so on) has not been measured. We make no claim about which codec sounds better at the same bitrate.
  • A codec that isn’t in the list is left as “Other codec” and the tool recommends .mka. It never rules an unknown codec as copyable.
  • If the audio in a file has its own encoder delay (a start offset) separate from the video, the extracted audio may start slightly differently. Listen to the result to check.