> basic conversion
The bread-and-butter ffmpeg tasks: changing a file's container (MP4, MKV, WebM) and/or its codecs. This covers fast lossless remuxing with stream copy, transcoding to H.264/H.265/AV1 for compatibility or smaller files, and stripping video to pull out an audio track. Knowing when you can copy streams versus when you must re-encode is the difference between a one-second job and a twenty-minute one.
// basic conversion
6 commands$ ffmpeg -i input.mp4 output.webm$ ffmpeg -i input.mkv -c copy output.mp4$ ffmpeg -i input.mkv -c copy output.mp4$ ffmpeg -i input.mp4 -c:v libx265 -crf 28 -c:a aac output.mp4$ ffmpeg -i input.avi -c:v libx264 -crf 23 -c:a aac output.mp4$ ffmpeg -i input.mp4 -vn -c:a libmp3lame -q:a 2 output.mp3// faq
How do I convert a video without re-encoding it?
Use -c copy to remux the streams into a new container: ffmpeg -i in.mkv -c copy out.mp4. This is near-instant and lossless because it never decodes the video; it only works if the target container supports the existing codecs.
What's the difference between remuxing and transcoding?
Remuxing (-c copy) rewraps the same encoded streams into a different container without touching the pixels — fast and lossless. Transcoding decodes and re-encodes with an encoder like libx264, which is slow, CPU-heavy, and lossy, but lets you change codec, resolution, or bitrate.
What CRF value should I use?
CRF is a quality target where lower means better quality and a bigger file. For libx264, 18-23 is the sweet spot (23 is the default); for libx265, roughly 28 gives comparable quality at a smaller size. Change CRF by ~6 to roughly halve or double the bitrate.