[Step-by-Step] How to Convert AVI to MP4 with FFmpeg?

FFmpeg is an open-source command line tool that was designed for processing multimedia files and streams. It supports a vast number of audio and video codecs and can be used to change video type to another. In this article, we’ll explore how to let FFmpeg convert AVI to MP4 format on Windows, Mac, and Linux.

Rocabella Rocabella | Updated on May 23, 2024

How to Convert AVI to MP4 with FFmpeg?

Though beginners need to go through a learning curve and easily make mistakes when using FFmpeg for the first time, it still makes one of the most popular media processing tools, not only for its endless capabilities but also for its great compatibility. Hence, you can perform FFmpeg AVI to MP4 conversion on various platforms.

(I’m assuming you already get the latest FFmpeg installed on your device. If not, you can go to https://ffmpeg.org/download.html to download and install it.)

Converting AVI to MP4 with FFmpeg on Windows

First, we’ll guide you through how to use FFmpeg command to convert AVI to MP4 on Windows:

Step 1. To bring up the command window, open the folder where your AVI video is. Then click to select the full file path and type in CMD instead. Press Enter to open the FFmpeg command window.

FFmpeg AVI to MP4

Step 2. Now you can enter the commands to start the format conversion. Enter the following commands line to use FFmpeg to convert AVI to MP4:
ffmpeg -i input_filename.avi output_filename.mp4

This is a typical command used in FFmpeg for video format conversion.
FFmpeg: refer to the FFmpeg software.
i: indicate the input file.
input_filename: replace it with the .avi file name that you want to convert.
output_filename: replace with the exported file name.

By default, FFmpeg re-encodes your video during conversion. But if you just want to let FFmpeg change container AVI to MP4, you can add the “copy” codec to make a copy of your file, thus you can make FFmpeg convert AVI to MP4 without losing quality. Here is the command line:
ffmpeg -i input_filename.avi -c:v copy -c:a copy output_filename.mp4

Convert AVI to MP4 FFmpeg Windows

Step 3. Make sure you enter the right command line and press the Enter key on your keyboard to start the conversion at once. You’ll find the output video file in the same folder as the input file.

FFmpeg Conversion Command for AVI-to-MP4 on Mac

Here is how can you perform AVI-to-MP4 conversion using FFmpeg on Mac.

Step 1. The easiest way to install FFmpeg on Mac is by using Homebrew. If you haven’t installed it, open the Terminal app and run the following commands:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Step 2. Be patient and wait for the download to complete. Then continue with these two commands to install and update FFmpeg:
brew install ffmpeg

brew update ffmpeg

Step 3. If you want to convert AVI to an MP4 file encoded with H.264 on Mac, use the below command:
ffmpeg -i input_filename.avi -c:v libx264 output_filename.mp4

Have a bunch of AVI videos for conversion? Then execute this command:
for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done

Make FFmpeg Convert .avi to .mp4 on Linux

For Linux users who want to change the video format container only, run this command:
Ffmpeg -i input_filename.avi output_filename.mp4

If you have specific parameter needs for the output, you just need to add the corresponding FFmpeg option to the command. For example, run this command to export the MP4 video encoded with MPEG-4 codec, 128kbps audio bitrate, and 1,200kbps video stream.
ffmpeg -i input_filename.avi -ab 128 -b 1200 -vcodec mpeg4 output_filename.mp4

Once you corner the learning curve, you can take advantage of these command lines to do various audio, video transcoding, editing, and conversion operations.

Also, an FFmpeg alternative is prepared below if you are working with Windows devices and prefer an easier solution. Without suffering from a deep learning curve, WonderFox Free HD Video Converter Factory enables even first-time users to convert video and audio within 3 steps!

More are described in detail below.

Free HD Video Converter Factory

Convert AVI to MP4, MOV, AVI, MP3, WAV, etc.
Compress video size with minimum quality loss;
Download videos from YouTube, Facebook, Twitter, etc.
Save YouTube playlists and channels for free;
Trim, crop, rotate, add watermark and video effects.

Bonus: Convert to MP4 with Easier FFmpeg Alternative on Windows

Import, convert, and export! WonderFox Free HD Video Converter Factory converter allows you to convert AVI and virtually all types of video and audio formats to 500+ output presets within 3 steps. Besides, you can adjust the output settings to change the AVI container to MP4 only.

In addition to format conversion, it supports editing and downloading as well. All are easy to use. Download and give it a bash!

Free Download

Compatible with Windows

100% Clean & Safe

Free Download

Step 1. Import AVI Video to the Free Converter

Launch the Free HD Video Converter Factory and enter the Converter module. Press the + Add Files button to load the source .avi video file or straightly drag it into the program.

Import AVI Video

Step 2. Select MP4 as the Output Format

Hit the format image on the right side to open the full list of 500+ output profiles. Click on the Video tab and select MP4.

FFmpeg Alternative Convert AVI

This program provides beginners with optimal presets. But it also enables you to customize the parameters if neeeded. Go to Parameter settings to modify settings like codec, resolution, bitrate, frame rate, etc.

Step 3. Start Conversion

Finally, hit the triangle button at the bottom to set a new output folder. You can also just leave it as default. Click Run to start the conversion at once.

Alternative to FFmpeg AVI to MP4

The Bottom Line

Which converter will you go for in the end after learning how to convert AVI to MP4 with FFmpeg and the easiest alternative. For novices, WonderFox Free HD Video Converter Factory is the better way to go. Simple yet professional! It’s worth a shot. Free download and install it here:

Free Download

Compatible with Windows

100% Clean & Safe

Free Download
Convert DVD Collection to Digital Files for Hassle-Free Playback
WonderFox DVD Ripper Pro

WonderFox DVD Ripper Pro

1. Rip DVD to 300+ presets with GPU acceleration.

2. Remove all sorts of DRM from DVD.

3. Compress an 8GB DVD to 1-2 GB digital video file.

4. 5-minutes to fast digitize DVD in MPEG-2 MPG.

5. Make a 1:1 intact digital copy (ISO or VIDEO_TS).

6. Multiple audio tracks, hard/soft and forced subs.

7. Support homemade/commercial DVD & ISO & Video_TS folder.

Specialized in multimedia software solutions.
Since 2009

Privacy Policy | Copyright © 2009-2024 WonderFox Soft, Inc.All Rights Reserved

Back to Top