Two different things get called "converting", and only one of them is slow. Knowing which one 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. Switching between them only rewrites the wrapper. It takes a second or two and changes nothing about the quality. Changing the codec means decoding every frame and compressing it again, which takes real time and loses a little quality each 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, almost instant. If
it fails because the codec isn't allowed 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 but play in fewer places. Pick them on purpose, 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 a variable bitrate at a set quality instead of a fixed number,
so bits go 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 lands on damage that is already there. Always convert from the best source you still have, not from whatever copy you happen to have open.
Pulling the audio out of a video
A common job, and one line does it:
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. That is instant and lossless:
ffmpeg -i video.mp4 -vn -c:a copy audio.m4a
Try the fast path first
- Try a stream copy.
-c copyinto the container you want. If it works, you are done: no quality lost, a few seconds spent. - If it errors, the codec isn't allowed in that container. Re-encode the
stream that causes the problem and copy the other one:
-c:v libx264 -crf 23 -c:a copy. - Only re-encode both when you have to. Every re-encode you skip is quality you keep.
When the browser tool earns its place
Not because it is faster. It isn't: 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 leaves a copy on somebody else's disk.
- You need it once. Installing ffmpeg to convert one voice memo is overkill.
- You are not on your own machine. A locked-down laptop, a Chromebook, a phone.
Real work takes real time. A long file is a long encode wherever it runs.