How to Convert AVI to MP4 in Linux

by Kristen Waters

The Mplayer program includes a utility for converting multimedia from one format to another called MEncoder. The MEncoder utility can be used to convert AVI video files to the MP4 format from the command line. The resulting video can be played on Apple iPods and other handheld devices. The MP4 format is based on the Apple Quicktime container format. MP4 can contain audio only, or audio and video together. However, the standard is to use MP4 to refer to video files and M4A to refer to audio only files.

1

Download and install MPlayer through your distribution's software repository, or from the MPlayer website.

2

Open a terminal window.

3

Type the command "mencoder input.avi -o output.mp4 -oac copy -ovc lavc -lavcopts vcodec=mpeg1video -of mpeg" to convert the AVI video to MP4.

4

Type the command "mplayer output.mp4" to test the video.

5

Type the command "exit" to close the terminal session.

Items you will need

About the Author

Kristen Waters has been writing for the computer industry since 2004. She has written training materials for both large and small computer companies as well as how-to and informative articles for many online publications. She holds Bachelor of Science degrees from both York College of Pennsylvania and the University of Maryland.

Photo Credits

  • photo_camera Thomas Northcut/Photodisc/Getty Images