AVI to MP4: How to Convert AVI Files (2026 Guide)
31 August 2026

AVI to MP4: How to Convert AVI Files (2026 Guide)

The most confusing thing about an AVI file is that “AVI” tells you almost nothing about the video inside it. AVI is a container from 1992, and the same .avi extension can hold completely different video formats: old DivX or Xvid encodes, MJPEG clips from early digital cameras, DV footage from camcorders, or in some cases modern H.264 that is only wearing an old coat.

That is also why “avi to mp4” has been one of the most persistent converter searches for two decades — the fix is usually simple, but only if you know what is inside the file.

One AVI plays everywhere; the next refuses to open on a phone, a smart TV, or a video editor. The answer is usually the same: convert the file to MP4 with H.264 video, which is the format modern devices expect.

This guide shows the honest way to do it — with ffmpeg, HandBrake, or VLC — and how to decide which one you need before you start.

avi to mp4: convert AVI files to H.264 MP4 with ffmpeg, HandBrake or VLC in 2026

The short answer up front: open a terminal with ffmpeg installed and run ffmpeg -i input.avi -c:v libx264 -crf 20 -c:a aac output.mp4 for most files, or use HandBrake or VLC if you prefer buttons.

In some cases you can skip re-encoding entirely and just change the container, which takes seconds — but that only works when the codec inside the AVI is already compatible. The first step is finding out which situation you are in.

Why AVI Files Stop Playing

AVI (Audio Video Interleave) was Microsoft’s video container for the Windows 3.1 era. Containers are just boxes that hold video and audio streams; the codec inside decides whether a device can decode them.

AVI files from the 2000s commonly contain MPEG-4 Part 2 video (DivX or Xvid), which modern players and televisions often no longer decode. Camera footage from the same era is frequently MJPEG or DV.

When your TV says “unsupported format,” the box is usually fine — the codec inside is what your device stopped supporting.

That distinction matters because it decides your route: if the video codec is already something modern (like H.264 or MPEG-4 Part 2), you may be able to remux — change only the container — in a few seconds. If it is DivX, Xvid, MJPEG, or DV, you need to re-encode the video into H.264, which takes longer but produces a file modern devices will actually play.

Step 1: See What Is Inside Your AVI

Before converting, spend ten seconds checking the codec. With ffmpeg installed, run:

ffprobe -v error -show_entries stream=codec_name -of csv=p=0 input.avi

The output lists the codecs in the file, one per line — something like mpeg4 or h264 for video and mp3 or ac3 for audio. This tells you immediately whether a remux will work (H.264 or MPEG-4 Part 2 video) or whether you need a full re-encode (DivX, Xvid, MJPEG, DV, and most other older codecs).

If ffprobe is not installed yet, you can also open the file in VLC and check Codec Information under the Tools menu — it shows the same details.

The Two Routes: Remux or Re-encode

Remux (container change, no re-encoding). If the codec inside is already compatible with MP4 — H.264 and MPEG-4 Part 2 are the common cases — you can copy the streams as they are into an MP4 container. This takes seconds, loses no quality, and uses almost no processing power. It does not change the video at all; it only changes the box around it.

Re-encode (full conversion). If the codec is older, the video must be decoded and re-encoded into H.264. This takes longer, and the output quality depends on the settings you choose. In most cases the difference is invisible at normal viewing sizes, and the result plays on phones, TVs, and editors that reject the original file. HandBrake and VLC always re-encode; ffmpeg can do either.

One caveat applies to both routes: conversion cannot fix a broken file. Corrupted AVIs may fail partway, and DRM-protected or encrypted video will not convert at all — no honest tool helps with that, and this guide does not cover bypassing protections.

Method 1: ffmpeg — the Command-Line Route

ffmpeg is a free, open-source tool from ffmpeg’s official site that reads and writes AVI and MP4, among many other formats. Install it with your package manager (Windows: winget install ffmpeg; macOS: brew install ffmpeg; Linux: sudo apt install ffmpeg), then convert:

# Re-encode to H.264 MP4 (the route for most AVI files)
ffmpeg -i input.avi -c:v libx264 -crf 20 -preset medium -c:a aac output.mp4

# Remux only — when the codec is already MP4-compatible (seconds, no quality loss)
ffmpeg -i input.avi -c copy output.mp4

What the settings mean: -c:v libx264 selects the H.264 encoder, -crf 20 sets quality (18–23 is the range most people use; lower is higher quality and a larger file), and -c:a aac re-encodes the audio to the format MP4 expects.

If the file’s audio is already AAC, the remux command copies it untouched. ffmpeg handles the common AVI codecs, and in most cases the first re-encode command above is all you need.

If a specific file still fails, run ffmpeg -i input.avi (no output file) to read the stream details and see which codec is causing the problem.

Method 2: HandBrake — the GUI Route

HandBrake is a free, open-source video transcoder from HandBrake’s official site built for exactly this kind of job: load a file, pick a preset, get an MP4. It reads common video files including AVI, and it always re-encodes — there is no remux option — which makes it a safe choice when you are not sure about the codec inside.

Open the app, choose your AVI file, pick the “Fast 1080p30” preset (or the resolution that matches your video), and start. The output is an H.264 MP4 that most modern devices play.

HandBrake is available for Windows, macOS, and Linux, and its quality slider works on the same RF scale as ffmpeg’s CRF.

Method 3: VLC — the Built-in Converter

If you already use VLC, the free media player, you may not need to install anything else: Media → Convert / Save lets you convert an AVI to MP4 using one of the bundled profiles.

Choose the file, pick a profile that outputs H.264 MP4 (the “Video for MPEG4 1080p” or “Video for H.264 + MP3 (MP4)” profiles are reasonable starting points), and convert. VLC re-encodes the video, and it is the most convenient option when you just want a quick result from a player you already have.

The trade-off is control: VLC’s conversion dialog offers fewer quality options than ffmpeg or HandBrake, which is fine for most files.

Quality and File Size: What to Expect

Re-encoding always involves a quality/size trade-off. H.264 at CRF 18–23 is visually very close to the source in most cases, and the output is usually smaller than the original AVI because H.264 compresses more efficiently than the old codecs.

Two honest expectations: you cannot add detail that was never there (a 480p source stays 480p), and if you want the biggest possible file with maximum quality, lower the CRF to 16–18 rather than raising the bitrate blindly.

For long or storage-heavy libraries, the settings in our guide to compressing video without losing quality explain the trade-offs in more depth.

Converting Several Files

For a folder of AVIs, a simple loop handles the batch (on Windows, run this in PowerShell; on macOS and Linux, in any terminal):

for f in *.avi; do ffmpeg -i "$f" -c:v libx264 -crf 20 -c:a aac "${f%.avi}.mp4"; done

Each file converts with the same settings. It is worth spot-checking the first output before letting a large batch run, because one odd file can fail without stopping the loop — the command above continues and reports the error for that file.

Troubleshooting: When Conversion Goes Wrong

The output has no sound. The audio codec was not converted. Re-run with -c:a aac (or -c:a copy only if the audio is already AAC).

The video is black or the output is tiny. The source codec was not decoded properly, or the file is corrupted. Check the stream details with ffprobe; if the codec is exotic, a full ffmpeg build (with all libraries) usually handles it, but some very old formats are simply not supported by every build.

“Unknown encoder ‘libx264’.” Your ffmpeg build lacks the H.264 encoder. Install a full build from ffmpeg’s official site rather than a minimal package.

The file still will not play on my TV. Televisions vary in which codecs they support even within MP4. H.264 (not H.265/HEVC) at a common resolution is the most compatible choice; if the TV still rejects it, check the TV’s manual for its supported formats.

Frequently Asked Questions

Does converting AVI to MP4 lose quality? Re-encoding introduces some compression, but at CRF 18–23 the difference is hard to notice in most cases. Remuxing copies the streams and loses nothing — when the codec allows it, that is the quality-preserving route.

Can I convert AVI to MP4 without re-encoding? Only when the codec inside is already MP4-compatible (typically H.264 or MPEG-4 Part 2). Run ffprobe first; if the video codec is older, a remux produces a file most players still reject, and a re-encode is the honest fix.

Why won’t my TV or phone play AVI files? Because they commonly contain old codecs the device no longer decodes. Converting to H.264 MP4 usually solves it, though support varies by device model.

Are ffmpeg, HandBrake, and VLC free? Yes — all three are free, open-source programs from their official sites, and none require an account.

Which Route Should You Use?

If the file plays somewhere and you just want a modern container, check the codec and remux with ffmpeg — seconds, zero quality loss. If the file does not play on your target device, re-encode: ffmpeg for speed and control, HandBrake for a friendly interface, VLC if it is already installed.

And if the file is corrupted or protected, no converter will help — that is the one case where the honest answer is to find another copy.

AVI is an old format, but your video is not lost. A five-minute AVI to MP4 conversion turns a file your TV calls “unsupported” into an MP4 that just plays — and once you know what is inside the container, the right tool is obvious.

Leave a Reply

Your email address will not be published. Required fields are marked *