Convert AVI to MP4
The AVI format dates from the late 1990s and often contains DivX or Xvid video, which phones, TVs and browsers handle poorly. Converting to MP4 (H.264 video, AAC audio) makes the video playable everywhere.
Updated on
The lower the number, the better the picture and the larger the file.
How to use it
- Install ffmpeg if you haven't already.
- Open a terminal in the folder containing your file.
- Copy the generated command, adjust the file names if needed, then run it.
- Open the resulting file to check the result.
AVI, DivX, Xvid: what are we talking about?
AVI is a container: it can hold different codecs. In most older files, the video is DivX or Xvid (two variants of MPEG-4 Part 2) and the audio is MP3. These codecs are outdated: at equal quality, H.264 produces a much smaller file, and it plays on all recent devices.
Convert a whole collection
To convert all the AVI files in a folder at once, use the script generator and choose the avi extension and the compression option.
Convert all the files in a folder
Frequently asked questions
Why not simply copy the video without re-encoding?
The video in an AVI is most often MPEG-4 Part 2 (DivX, Xvid), a codec that many players no longer play inside an MP4. Re-encoding to H.264 guarantees compatibility.
Does the conversion lose quality?
Re-encoding always loses a little information, but with a CRF of 18 to 20 the difference is invisible to the eye. Since old AVI files are often low resolution, the resulting MP4 file is generally smaller than the original.
ffmpeg shows warnings about timestamps. Is that serious?
No, it is common with old AVI files whose indexes are imperfect. If the resulting video is out of sync, add "-fflags +genpts" just before "-i".
More tools
- Convert MKV to MP4 without re-encoding
- Convert MOV to MP4 (iPhone videos)
- Convert all files in a folder with ffmpeg (script)
- Convert WebM to MP4
- Convert an HEVC (H.265) video to H.264
- Convert MP4 to MKV without re-encoding
- Convert MP4 to WebM (VP9 and Opus)
- Convert a video for DaVinci Resolve (ProRes, DNxHR)