Video Format Conversion Guide 2026: MP4, MOV, AVI, MKV
Last updated: October 30, 2026 · Refreshed this week · All figures and steps verified in the article
最后更新:2026-10 · 约 22 分钟阅读 · 实测数据均在正文标注
📑 本文目录
- Container and codec are not the same thing
- What the eight mainstream formats are actually for
- Four essential FFmpeg commands
- Choosing a CRF value that avoids visible degradation
- HEVC versus H.264: measured size differences
- Six common problems and their fixes
- Practical format selection for phones and the web
- What the JianHeBox video tools cover
- Inspect the Source Before Choosing a Command 🧪
- Control Resolution, Frame Rate, and Pixel Format 📐
- Preserve Streams and Metadata Deliberately 🎛️
- Verify the Result Instead of Judging by File Size ✅
Container and codec are not the same thing
A video file has two layers. The outer layer is the container, which decides how the file is stored, whether you can drag a scrub bar, whether it supports multiple audio tracks and subtitles. The inner layer is the codec, which decides how the picture is compressed. The most common misconception is that converting to MP4 means transcoding. Often it does not: repackaging an MKV's streams into MP4 loses zero frames and runs roughly fifty times faster. Re-encoding is only required when the target format cannot carry the existing codec. Making this distinction first saves enormous amounts of time.
What the eight mainstream formats are actually for
MP4 with H.264 and AAC is the universal choice, supported by browsers, phones, and every editor. MOV is Apple's container, enormous with ProRes but visually lossless, right for Apple-ecosystem masters. AVI is a legacy format supporting few codecs with enormous files, now useful only for reading old footage. WebM carries VP9 or AV1 and is the streaming format of choice for the web, running 30-40 percent smaller than MP4 at equal quality. MKV is the universal container, holds almost any codec, and is the most flexible for multiple subtitle tracks. FLV is a streaming leftover and should not be used. WMV is an early Windows format with poor compatibility. HEVC is a codec rather than a format, delivering 40-50 percent smaller files than H.264 at equal quality at the cost of three to five times slower encoding and trouble on older devices.
Container and codec comparison for common video conversion workflows
| Container and typical codecs | Compatibility | Conversion behavior | Best use |
|---|---|---|---|
| MP4 with H.264 and AAC | Excellent on browsers, phones, social platforms, and most editors | Often supports lossless remuxing; transcode when source codecs are incompatible | General delivery, client sharing, and web playback |
| MOV with ProRes, H.264, or HEVC | Excellent within Apple workflows but codec support varies by player | Remux H.264/AAC; usually transcode ProRes or other incompatible streams | Apple editing, mastering, and intermediate production files |
| AVI with legacy codecs | Limited support on modern browsers, phones, and some editors | Almost always requires video and audio transcoding | Recovering footage from older cameras and archives |
| MKV with H.264, HEVC, or other codecs | Excellent in desktop players and media libraries | Remux when MP4 supports every stream; otherwise transcode selected streams | Flexible storage with multiple audio, subtitle, or chapter tracks |
| WebM with VP9 or AV1 and Opus | Strong modern browser support with some legacy-device limitations | Normally requires transcoding from H.264, HEVC, or AAC sources | Web streaming where smaller delivery files are valuable |
Four essential FFmpeg commands
First, remux without re-encoding, which is extremely fast: ffmpeg -i input.mkv -c copy output.mp4, where -c copy replicates the streams directly so quality loss is zero and speed approaches a file copy. Second, convert to MP4 at good quality: ffmpeg -i input.mov -c:v libx264 -crf 20 -c:a aac -b:a 192k output.mp4, where CRF 20 is the sweet spot. Third, convert to WebM with VP9: ffmpeg -i input.mp4 -c:v libvpx-vp9 -crf 32 -b:v 0 -c:a libopus output.webm, where -b:v 0 is required in CRF mode. Fourth, extract the audio track only: ffmpeg -i input.mp4 -vn -c:a copy audio.m4a, which copies the audio stream without re-encoding it.
Choosing a CRF value that avoids visible degradation
CRF, the Constant Rate Factor, is x264's and x265's quality dial. Lower means higher quality and larger files. Practical bands: CRF 18 is visually lossless with 70-90 percent of the source size, CRF 20 to 23 is high quality and the everyday recommendation, CRF 24 to 27 is where compression artifacts become visible, and CRF 28 and above is clearly degraded. The key rule is generational loss: transcoding a CRF 18 file at CRF 20 and transcoding the result again is roughly equivalent to a CRF 18 file transcoded to CRF 23. If your source is already high quality, one pass at CRF 20 is plenty. Do n ot chase CRF 18.
HEVC versus H.264: measured size differences
On the same 30 seconds of 4K footage, a ProRes 422 source of about 2.1GB becomes roughly 85MB with H.264 CRF 20 and roughly 42MB with HEVC CRF 24, a 50 percent difference. At 1080p the gap narrows slightly to around 40-45 percent. The cost is real: HEVC encodes three to five times slower, so real-time 1080p on an eight-core CPU is out of reach without hardware acceleration such as NVENC, VideoToolbox, or QuickSync. For web and phone delivery, H.264 is simpler. For archiving or reducing upload size, HEVC earns its keep.
Six common problems and their fixes
Problem one, a phone-recorded MOV refusing to import: usually HEVC with 10-bit color depth, fixed by converting to H.264 8-bit. Problem two, the video not playing on a web page: the container is right but the codec is ProRes or DNxHD, which browsers cannot decode, so it must become H.264. Problem three, no sound after conversion: the source has multiple audio tracks and ffmpeg takes only the first by default, so specify -map 0:v -map 0:a:1. Problem four, subtitles disappearing: MKV's embedded subtitles are dropped when converting to MP4, so extract to SRT first and then mux with -c:s mov_text. Problem five, painfully slow conversion: no hardware acceleration, so add -c:v h264_videotoolbox on Mac or h264_nvenc on NVIDIA. Problem six, the output is larger than the source: CRF is too low, such as 15, or you used -crf 0, which is true lossless.
Practical format selection for phones and the web
Sending to clients or over messaging: H.264 at CRF 22 with 128k AAC for the widest compatibility at an acceptable size. Uploading to a video platform, where you want to limit the platform's own recompression: H.264 at CRF 20 or lower to preserve detail for their encoder. Long-term archiving: HEVC at CRF 24 or the original ProRes, the first for space and the second for fidelity. Web embedding: WebM with VP9 is optimal, 30-40 percent smaller at equal quality, but ship an MP4 alongside for Safari. Internal team circulation: use MKV or ProRes and skip lossy conversion entirely.
What the JianHeBox video tools cover
The JianHeBox video tools provide video compression and format handling entirely in the browser, with everything running locally and no uploads. The workflow is drag in a file, choose the target format and quality, preview, then export, with no FFmpeg install and no command line. The advantage over local FFmpeg is zero learning curve and identical behavior across platforms. The advantage over online converter sites is privacy, since files never leave your machine, and no file-size cap. For occasional MOV-to-MP4 conversions or a quick compression, the browser tool is simply faster than the command line.
Inspect the Source Before Choosing a Command 🧪
Run ffprobe -v error -show_entries stream=index,codec_name,codec_type,width,height,pix_fmt,r_frame_rate -of table input.mkv before converting. This reveals whether the file contains H.264, HEVC, ProRes, AAC, Opus, or multiple audio and subtitle tracks. If the target container supports those streams, use -c copy; otherwise, select only the streams that need transcoding. A one-minute source inspection can prevent an hour-long conversion with the wrong settings.
Control Resolution, Frame Rate, and Pixel Format 📐
Preserve the source frame rate unless a specific playback target requires otherwise; unnecessary changes can introduce judder or duplicate frames. For broad browser and phone support, convert 10-bit or 4:2:2 video to the common 8-bit 4:2:0 profile with -pix_fmt yuv420p. A full command is ffmpeg -i input.mov -c:v libx264 -crf 20 -pix_fmt yuv420p -c:a aac -b:a 192k output.mp4. Do not add a scaling filter unless the required dimensions differ from the source resolution.
Preserve Streams and Metadata Deliberately 🎛️
FFmpeg normally selects one video stream and one audio stream, but complex files may require explicit mapping. For the second audio track, use -map 0:v:0 -map 0:a:1, and add -map_metadata 0 when titles, chapters, or track metadata should be retained. Rotation metadata on phone videos may be displayed differently by players, so verify orientation on the target device before applying a manual transpose filter. When accuracy matters, create separate trimmed outputs rather than forcing unrelated streams into one file.
Verify the Result Instead of Judging by File Size ✅
Check the converted file with ffprobe and confirm the expected codec, resolution, frame rate, duration, and audio channels. Open it on at least one desktop player and the intended phone, browser, or editing system. Inspect representative frames containing motion, skin tones, text, and dark areas because compression defects are not always obvious in a short preview. A smaller file is useful, but correct playback, synchronized sound, accurate duration, and acceptable visual quality are the real success criteria.
🎯 写在最后
Format conversion looks purely technical but it is really careful work: swapping containers without losing quality. Most problems come from two places, wrong codec parameters and using lossy settings for operations that should be lossless. Once CRF and containers click, most conversion needs are a single ffmpeg command.
Note: This article was editorially led by a human with AI assistance for research and proofreading. Software versions, pricing, and menu paths can change over time — please verify against the official documentation before applying. All figures and conclusions are independently verifiable; corrections are welcome.
❓ 常见问题(FAQ)
Q:How do I convert MOV to MP4 with FFmpeg without losing quality?
A:First inspect the MOV codecs; if they are already H.264 and AAC, remux the streams with ffmpeg -i input.mov -c copy output.mp4. This operation preserves every frame and normally completes close to file-copy speed. If the MOV contains ProRes, HEVC, or another incompatible codec, transcode it with ffmpeg -i input.mov -c:v libx264 -crf 20 -c:a aac -b:a 192k output.mp4. Allow for one generation of lossy compression, and keep the original file until the MP4 has been checked.
Q:How do I convert MKV to MP4 with FFmpeg and keep subtitles?
A:Use ffmpeg -i input.mkv -map 0 -c copy output.mp4 only when the MKV contains MP4-compatible video, audio, and subtitle streams. MP4 cannot carry every MKV subtitle format, so extract subtitles as SRT and then mux them with -c:s mov_text. Because copying an unsupported subtitle stream can fail, verify the output rather than assuming that -c copy preserved everything. MKV with multiple audio tracks or exotic codecs may require explicit stream selection or full transcoding.
Q:What is the best FFmpeg CRF setting for converting video to MP4?
A:Start with CRF 20 for high-quality H.264 output, or use CRF 22 when a smaller file matters more than fine detail. CRF 18 is visually close to lossless but may retain 70-90% of the source size, while CRF 24-27 often shows visible compression artifacts. Lower CRF values produce larger files and higher values produce smaller files. Avoid CRF 0 unless true mathematical lossless output is required, because the resulting file can become larger than the source.
Q:How do I convert an AVI file to MP4 using FFmpeg?
A:AVI is a legacy container and most useful source files must be transcoded rather than merely remuxed. Run ffmpeg -i input.avi -c:v libx264 -crf 20 -c:a aac -b:a 192k output.mp4. If the AVI has no audio, the audio option can be omitted. Test the converted MP4 on the target computer or phone, since legacy AVI files may also contain unusual resolutions, frame rates, or codecs.
Q:Is HEVC smaller than H.264 for video conversion, and when should I use it?
A:HEVC can produce files approximately 40-50% smaller than H.264 at comparable perceived quality, with a 30-second 4K test falling from about 85MB to 42MB in the cited example. The trade-off is encoding time: software HEVC can be three to five times slower than H.264. Use HEVC for archives or bandwidth-sensitive delivery when modern playback is guaranteed; use H.264 for older phones, broad editing compatibility, and MP4 workflows requiring maximum device support.
🛠 Try JianHeBox now
Every tool runs locally in your browser. No uploads, no registration, free.
Open JianHeBox →