The next few paragraphs explain what MP4 playback is all about, and is recommended that you read this section if you've never played around with MP4 files before. For those that are impatient, skip to the sample instructions below for precise steps on how to playback MP4 files encoded with H.264/DivX/XviD and MP4/AAC audio.
MP4 is a container format. What this means is that, like the AVI format, MP4 files can include a video track encoded in various formats (codecs). It can also include multiple audio tracks (also supporting various codecs) and also subtitle and even chapter information. As such, there is no single method for playing back all MP4 files, since the playback is totally dependent on which codec the file is encoded with.
However, the MP4 container is most commonly used with MPEG-4 SP/ASP (available in variety of forms, including DivX, XviD) and AVC (H.264) video, with MP3, AC3 or AAC audio. AVI is still the most popular container format for forms of MPEG-4 ASP (with MP3 audio), and so most recent MP4 files you download will be H.264 with AAC audio thrown in for good measure (AAC is more compressible than MP3, in the same way AVC/H.264 is more compressible than ASP). In fact, MP4 with H.264 is so common these days, many people simply refer to it as H.264 (or x264, but that's slight misnomer as it refers to a very popular H.264 encoder).
To playback MP4 files under Windows, you'll need several things that makes up a typical Directshow based playback method. You'll first thing you need is a MP4 splitter/parser to separate the MP4 file into its separate audio, video (chapters, subtitles) elements.
The next thing you need a decoder (or decoders) to support whichever codec the video/audio are encoded in. This can usually be easily achieved using an universal decoder like ffdshow (universal because it supports practically every format there is, including DivX/XviD/H.264).
And of course, you'll need a player software which supports the aforementioned splitters and decoders. Again, this is easily available in the form of Media Player Classic, an open source multimedia player.
For those not using Windows, there are alternative software (some also work under Windows) like Apple QuickTime, MPlayer, VideoLAN, xine...
Both the Xbox 360 and PS3 also support MP4/H.264 playback. Guides are available here to show you how to make and play MP4/H.264 files on the Xbox 360 and PS3. In addition to consoles, many other devices such as the Apple TV both support MP4/H.264, and there are one-click encoders specifically available to make compatible files for these devices (see the iPhone and Apple TV links for guides).
Below are sample instructions on how to get MP4 playback happening in Media Player Classic (MPC) and Microsoft's Windows Media Player (WMP_. Assuming you do not have any video codecs installed prior (like DivX or XviD codecs), the method below will support any MP4 file using H.264/DivX/XviD video and MP4/AAC audio.
- Download the MPC version that is suitable for your operating system
- MPC is really just a single executable, so extract the .exe file to any directory you wish (eg. c:\Program Files\Media Player Classic\)
- Click on the .exe file to start MPC. Easy.
- Download ffdshow and start the installation. Click "Next" until you get to the "Select Components" screen, and make sure you select the "VFW interface" option. Press "Next" to continue.
- When you reach the "Select Additional Tasks" screen, it will now allow you to select which codecs ffdshow will decode for you (if you already have ffdshow installed, the current selected decoders will be shown). Select the "H.264, X264", "XviD" and/or "DivX 5" video options (if you already have the separate XviD and DivX codecs installed, selecting these then becomes optional). Also select the "MP3" and "AAC" options for audio. You may select other options to allow ffdshow to be the decoder for these types of video as well, but that's optional.
- The "Postprocessing" and "Volume normalization" options further down is optional. ffdshow supports a lot of advanced postprocessing filters, such as video sharpening and audio effects. These can be configured later on (see "Existing Install" section below) as well.
- Press "Next" and then "Install" to start the installation. You do not need to run any of the configuration tools when presented with the option, so de-select them and press "Finish" to end the installation.
- Once ffdshow has finished installing, please go to the "Installing Haali Media Splitter" section below".
Installing Haali Media Splitter:
- This section is for when you already have ffdshow installed on your system. You can (and probably should) grab the latest version of ffdshow and run the install, which will update your current ffdshow version but keep your current settings. In any case, from the start menu, go to the ffdshow folder and run the "video decoder configuration" program.
- In the "Codecs" section, we will select which decoder is to be used for the listed formats. Make sure the "libavcodec" option is selected for "H.264". If you are using ffdshow to decode DivX/XviD, then select either "libavcodec" or "XviD" (my choice) for the "XviD" and "DivX 5" formats. Press "Apply" and then "OK" to close this program.
- From the start menu folder again, select "Audio decoder configuration". In the "Codecs" section, make sure the "libfaad2" option is selected for "AAC" and "libmad" is selected for "MP3". Press "Apply" and then "OK" to close this program.
- Certain older playback software and some conversion tools also require the VFW (Video For Windows) config to be made (this isn't necessary for this method), and you can do this through the "VFW codec configuration" option again in the ffdshow start menu folder. Go to the "Decoder" section by clicking on the "Decoder" tab at the top, select "Codecs" and just like before, make sure the "H.264", "XviD" and/or "DivX 5" formats have a decoder option selected. Press "Apply" and then "OK" to close this program.
- ffdshow is now configured for H.264/XviD/DivX/MP3/AAC playback.
Associating .mp4 files with MPC:
- This step is optional for MPC, but required for WMP.
- Download Haali Media Splitter
- Run the installer and when you get to the option select step, make sure the "Enable MP4 support" option is selected.
- Right click on the ".mp4" you are using for this test. From the menu that opens, select the "Open With -> Choose Program" option, or if it isn't there, select "Open".
- Click on "Browse" and locate your MPC .exe file (eg. c:\Program Files\Media Player Classic\mplayerc.exe). Select the "Always use the selected program ..." option if you want to make the association permanent. Press "OK" to close the window.