3/16/2026

Learn how to convert videos to MP4 format while maintaining perfect quality. Includes CRF settings, codec comparison, and best practices.

How to Convert Video to MP4 Without Losing Quality

Converting videos to MP4 while preserving quality is one of the most common needs for content creators, video editors, and anyone working with multimedia files.

Why Quality Matters

When converting videos, you don't want to lose that crisp detail or clear audio. Whether you're preparing content for YouTube, archiving home movies, or creating tutorials, quality matters.

The Best Command for Quality Preservation

ffmpeg -i input.avi -c:v libx264 -crf 18 -c:a aac -b:a 192k -pix_fmt yuv420p output.mp4

Understanding the Parameters

  • -crf 18: Range 0-51, lower = better quality. 18-23 is the sweet spot
  • -c:a aac -b:a 192k: High-quality audio at 192kbps
  • -pix_fmt yuv420p: Ensures compatibility with all players

CRF vs Bitrate - Which is Better?

CRF (Constant Rate Factor) - Recommended

ffmpeg -i input.mov -c:v libx264 -crf 20 -preset medium output.mp4

CRF maintains consistent quality across the entire video.

Two-Pass Encoding - For Precise Control

ffmpeg -i input.mp4 -c:v libx264 -b:v 5M -pass 1 -f null -y
ffmpeg -i input.mp4 -c:v libx264 -b:v 5M -pass 2 output.mp4

Preset Speed vs Quality

Preset Speed Quality
ultrafast Fastest Lowest
fast Fast Good
medium Normal Very Good
slow Slow Excellent
veryslow Slowest Best

Common Format Conversions

MOV to MP4

ffmpeg -i input.mov -c:v libx264 -crf 20 -c:a aac output.mp4

MKV to MP4

ffmpeg -i input.mkv -c:v libx264 -crf 20 -c:a aac output.mp4

AVI to MP4

ffmpeg -i input.avi -c:v libx264 -crf 20 -c:a aac output.mp4

Troubleshooting

Q: Output file is larger than input? A: Use higher CRF value (25-28) or add -preset fast

Q: Video plays but has no sound? A: Make sure to include -c:a aac or copy audio: -c:a copy

Q: Colors look wrong on some players? A: Add -pix_fmt yuv420p for maximum compatibility

Quick Reference

# Best quality (larger file)
ffmpeg -i input -c:v libx264 -crf 18 -preset slow output.mp4

# Good quality (balanced)
ffmpeg -i input -c:v libx264 -crf 23 -preset medium output.mp4

# Small file (lower quality)
ffmpeg -i input -c:v libx264 -crf 28 -preset fast output.mp4

# Copy streams (no re-encoding, fastest)
ffmpeg -i input -c copy output.mp4

Master these commands, and you'll never lose quality in video conversion again!