Two things get called "converting" and only one of them is expensive. Knowing which you need is most of the job.
Container versus codec
The container is the wrapper: .mp4, .mkv, .mov, .webm. It says how the
streams are packed and what metadata rides along.
The codec is how the picture and sound are actually compressed: H.264, H.265, VP9, AAC, MP3, Opus.
An MP4 and a MOV can contain byte-identical H.264 video and AAC audio. Changing between them is a rewrite of the wrapper — a second or two, no quality change at all. Changing the codec means decoding every frame and compressing it again, which takes real time and loses a little quality every pass.
When the codecs already suit the target container, copy the streams instead of re-encoding:
ffmpeg -i input.mov -c copy output.mp4
-c copy is the whole trick: no decoding, no quality loss, near-instant. When
that fails — because the codec is not legal in the new container — drop the flag
and let it re-encode:
ffmpeg -i input.mkv -c:v libx264 -crf 23 -c:a aac -b:a 192k output.mp4
Picking a target
Video
| Container | Codec | Use it when |
|---|---|---|
| MP4 | H.264 + AAC | You want it to play everywhere |
| WebM | VP9 + Opus | Web delivery, smaller at the same quality |
| MKV | anything | Archiving; holds multiple tracks and subtitles |
| MOV | H.264 / ProRes | Handing footage to an editor |
MP4/H.264 is the safe answer. Newer codecs (H.265, AV1) give better quality per byte and worse compatibility; pick them deliberately, not by default.
Audio
| Format | Lossy? | Use it when |
|---|---|---|
| FLAC | No | Archiving. Lossless, roughly half the size of WAV |
| WAV | No | Editing, or feeding another tool. Uncompressed and large |
| MP3 | Yes | Maximum compatibility |
| AAC | Yes | Better than MP3 at the same bitrate; standard in MP4 |
| Opus | Yes | Best of the lot at low bitrates; less universally supported |
ffmpeg -i song.wav -c:a flac song.flac # lossless archive
ffmpeg -i song.wav -c:a libmp3lame -q:a 2 song.mp3 # ~190 kbps VBR
-q:a 2 asks for variable bitrate at a quality level rather than a fixed number,
which spends bits where they are needed. It is a better default than -b:a 192k.
WAV → MP3 loses quality once. MP3 → AAC loses it twice, and the second loss is applied to damage that is already there. Always convert from the highest-quality source you still have, not from the copy you happen to have open.
Pulling the audio out of a video
A common job with a one-line answer:
ffmpeg -i video.mp4 -vn -c:a libmp3lame -q:a 2 audio.mp3
-vn means "no video". If the audio inside is already in a format you want,
copy it out untouched instead — instant and lossless:
ffmpeg -i video.mp4 -vn -c:a copy audio.m4a
Try the fast path first
- Attempt a stream copy.
-c copyinto the container you want. If it succeeds, you are done — no quality lost, seconds spent. - If it errors, the codec is not permitted in that container. Re-encode the
stream that is the problem, and copy the other one:
-c:v libx264 -crf 23 -c:a copy. - Only re-encode both when you actually need to. Every avoided re-encode is quality you keep.
When the browser tool earns its place
Not because it is faster — it is not; it is the same encoder with less of your CPU. It earns its place when:
- The material is private. Interview footage, medical recordings, anything under NDA. An upload-based converter is a copy on somebody else's disk.
- You need it once. Installing ffmpeg to convert one voice memo is disproportionate.
- You are not on your own machine. A locked-down laptop, a Chromebook, a phone.
Expect real time for real work — a long file is a long encode wherever it runs.