The fastest way depends on what file you have now
Converting a video to MP4 usually takes one of three routes: a free desktop program that handles most formats, an online converter if you do not want to install anything, or a command-line tool if you are comfortable with text commands. Which one works fastest depends on your original file type, how large the file is, and whether you need to change the video quality or just the container format.
MP4 is a container — a wrapper that holds video, audio, and subtitles together. Many video files are already MP4 containers but use different codecs inside them. If your file is already H.264 video and AAC audio, conversion can be nearly instant because the program just rewraps the data without re-encoding. If your file uses older codecs like MPEG-2 or uses a different container like AVI or MOV, the program has to re-encode, which takes time proportional to the file length and your computer's speed.
Key Takeaways
- FFmpeg is free, works on Windows, Mac, and Linux, and handles nearly every video format, but requires typing commands in a terminal window.
- HandBrake is a free desktop program with a visual interface that converts video and lets you adjust quality, bitrate, and resolution without learning command syntax.
- Online converters like CloudConvert or Zamzar work in your browser and need no installation, but upload and download speeds limit them to files under a few gigabytes.
- If your file is already H.264 video and AAC audio, a remuxer like MP4Box can rewrap it in seconds without re-encoding.
- Re-encoding takes time — expect roughly one-third to one-half the video length on a modern computer, longer on older machines.
Using FFmpeg from the command line
FFmpeg is the most powerful option and works on Windows, Mac, and Linux. It is free and handles virtually every video codec and container. The trade-off is that you run it from a terminal or command prompt, not a graphical interface.
To install FFmpeg on Windows, download the build from ffmpeg.org, extract the folder, and add it to your system PATH so you can type ffmpeg from any folder. On Mac, use Homebrew: brew install ffmpeg. On Linux, use your package manager: sudo apt install ffmpeg on Ubuntu or Debian.
The basic command to convert any video to MP4 is:
ffmpeg -i input.avi -c:v libx264 -c:a aac output.mp4
This tells FFmpeg to read the input file, encode video as H.264 (the standard MP4 video codec), encode audio as AAC (the standard MP4 audio codec), and write the result. The conversion runs in your terminal window and shows progress as a percentage. For a two-hour video on a modern computer, expect 30 to 60 minutes depending on your processor and the original codec.
If you want to preserve the original quality, add -crf 18 (lower numbers mean higher quality, 18 is visually lossless). If you want smaller file size, use -crf 28 (the default is 23). If you want to change resolution, add -s 1280x720 to scale to 720p.
Using HandBrake for a visual interface
HandBrake is a free desktop program that wraps FFmpeg in a graphical interface. You open a file, choose your settings, and click Start — no terminal required. Download it from handbrake.fr for Windows, Mac, or Linux.
Open HandBrake, click Source and select your video file. The program shows you the video duration, frame rate, and current codec. Click the Format dropdown and select MP4. Under the Video tab, you can choose your encoder (H.264 is standard), quality level (Quality slider), or target bitrate (Bitrate field). The Audio tab lets you pick AAC as the audio codec.
Click Start and HandBrake begins converting. It shows elapsed time, remaining time, and current frame rate. The window stays responsive so you can use your computer while it works. For most videos, HandBrake produces smaller files than FFmpeg's defaults because it uses more aggressive compression settings.
Using online converters for quick conversions
If you do not want to install software, online converters like CloudConvert, Zamzar, or Online-Convert let you upload a file, choose MP4 as the output format, and download the result. These work in any web browser.
The main limitation is file size and speed. Most free online converters cap uploads at 500 MB to 2 GB depending on the service. Upload and download speeds depend on your internet connection and the service's servers. A 500 MB file might take 5 to 15 minutes total (upload, conversion, download) depending on how busy the service is.
CloudConvert and Zamzar both let you adjust quality and resolution before converting. Some services offer paid plans that remove file size limits and give you faster processing. For occasional small files, online converters are convenient. For regular use or large files, a desktop program is faster.
Remuxing instead of re-encoding when possible
If your original file is already H.264 video and AAC audio — which is common for MP4, MOV, and some MKV files — you do not need to re-encode. You only need to remux, which means rewrapping the video and audio into a new container. This takes seconds instead of minutes.
In FFmpeg, remuxing looks like this:
ffmpeg -i input.mov -c copy output.mp4
The -c copy flag tells FFmpeg to copy the video and audio streams without re-encoding. The file size stays nearly identical and the process finishes in seconds.
To check what codecs your file uses, run ffmpeg -i yourfile.avi with no output file. FFmpeg prints the codec information: look for "Video:" and "Audio:" lines. If you see "h264" and "aac", remuxing works. If you see "mpeg2video" or "libmp3", you need to re-encode.
Choosing quality settings for your needs
Video quality and file size are a trade-off. Higher quality means larger files and longer conversion time. The right choice depends on where you will watch the video.
For streaming or sharing online, use H.264 at 18 to 23 quality (FFmpeg's CRF scale). This looks good on phones and tablets and keeps file size reasonable. For archiving or editing, use 16 to 18. For casual viewing or storage, use 24 to 28.
Bitrate is another way to control quality. A typical MP4 for streaming uses 2 to 6 Mbps for video. To set bitrate in FFmpeg, use -b:v 4M for 4 megabits per second. HandBrake's presets (Fast, Normal, High Quality) adjust these settings automatically.
Resolution also affects file size. A 1080p video takes roughly four times as long to encode as 720p. If your original is 1080p but you only need 720p, scaling down saves time and space. In FFmpeg, add -s 1280x720. In HandBrake, use the Dimensions tab.
Troubleshooting common conversion problems
If FFmpeg says "Unknown encoder", you may have installed a minimal build. Download the full build from ffmpeg.org or use Homebrew on Mac, which includes all codecs.
If the audio is out of sync after conversion, the original file may have variable frame rate video. In FFmpeg, add -vsync vfr to preserve the original timing. If that does not work, try -vsync cfr to force constant frame rate.
If conversion is very slow, check your CPU usage. If it is below 50 percent, your computer may be reading from a slow drive. Moving the file to a faster drive or SSD speeds things up. If CPU is maxed out, the conversion is running as fast as your processor allows. Closing other programs frees up CPU time.
If the output file is much larger than expected, check the bitrate. In FFmpeg, the default CRF of 23 is reasonable for most videos. If you used a low CRF (high quality), the file will be large. If you used a high bitrate, reduce it with -b:v 3M instead of -b:v 8M.
Frequently Asked Questions
Can I convert a video without losing quality?
If your original file is already H.264 video and AAC audio, remuxing preserves quality completely because no re-encoding happens. If you need to re-encode, use a low CRF value (16 to 18 in FFmpeg) or the High Quality preset in HandBrake. The file will be larger but visually lossless.
How long does it take to convert a video?
Remuxing takes seconds. Re-encoding typically takes one-third to one-half the video length on a modern computer — a two-hour video takes 40 to 120 minutes depending on your processor, the original codec, and your quality settings. Older computers or lower quality settings take longer.
What if my file is in a format I do not recognize?
Run ffmpeg -i yourfile to see what codecs it contains. FFmpeg prints the video codec, audio codec, resolution, and frame rate. Search for the codec name online if you are unsure. FFmpeg can convert from nearly any codec to MP4.
Is it safe to use online converters with private videos?
Most online converters delete files after a few hours, but they do upload your file to someone else's server. If your video is sensitive or confidential, use a desktop program like HandBrake or FFmpeg instead, which keeps everything on your computer.
Can I convert multiple files at once?
HandBrake has a queue feature: add multiple files, set the same output settings for all of them, and click Start. It converts them one after another. In FFmpeg, you can write a batch script (on Windows) or a shell script (on Mac and Linux) to loop through files and convert each one with the same command.