MP4 File Corruption Explained and How to Fix It
No matter how careful you are, if you shoot video on a regular basis, there are always chances things may go wrong and be out of your control. This could be a dead battery, a faulty SD card, a dropped camera, or accidentally deleted MP4 video files that you haven’t backed up. But as long as the video and audio streams are intact, there is a very good chance that your corrupted MP4 files can be fixed.
Why MP4 Video File Corruption Occurs
You will notice a corrupted mp4 file when trying to play it. Some possible outcomes can be a black screen, an error message, sudden stop during playback etc. The following are the most common reasons why MP4 files get corrupted:
- Unexpected recording interruption. This is one of the most common causes and it can happen when the camera shuts off due to a dead battery, or if you accidentally drop the camera while it is still recording the video.
- Power outage while downloading/transferring the video file to/from a computer.
- Recovering an unintentionally deleted MP4 file with recovery tools can also result in a corrupted or unplayable video.
In all of these cases, the MP4 file isn’t finalized and doesn’t have the necessary indices, which are enclosed as a part of the media container. Such corrupted MP4 files may also miss or have damaged headers. Both indices and headers are required for media players to play MP4 videos properly.
Indices in video files are needed to allocate certain parts of the video frames, while headers contain important information about codecs needed to decode the video. Without them, the player can’t allocate and decode video frames properly making the MP4 file unplayable.
However, if the actual audio and video streams are not damaged (which is almost always the case), there are quite high chances to fix the corrupted MP4 file simply by recovering its header along with indices.
How Do You Fix Corrupted MP4 Files?
To fix corrupted MP4 files, you would obviously need to recover damaged (or insert missing) header/indices. But how can you do this?
Luckily, there are tools that can do this for you. Most of such tools need a reference file – a valid video recorded with the same camera and settings as your corrupted MP4 file. The reference video must have the same bitrate and resolution as the corrupted one. Video recovery tools will use data from the reference file to fix damaged headers and re-build indices in your corrupted video.
How to Use Video Recovery Tools
Note: Before running any of these tools, make sure to back up the original video file.
K-Lite Codec Pack and VLC Media Player
Some powerful media players have the option to read MP4 files that have partially damaged indices. Before going into specific video recovery tools, you can first try to play the corrupted MP4 file in one of such media players.
For Windows users, the best option would be to try the K-Lite Codec Pack – a free and one of the most powerful codec packs out there, which comes with Media Player Classic. We recommend using both the K-Lite Codec Pack and the Media Player Classic, as these are among the most advanced software that Windows users can use for free to play all common types of video files. Not only that, the Media Player Classic is reported to be able to play MP4 files that have damaged indices.
For macOS users, you can try to play the damaged video in the VLC media player. This is also a free and powerful media player, which has in-built codecs needed to play MP4 files.
If neither of the media players couldn’t open your corrupted MP4 video, this is time to try to fix it with a video recovery tool. There are several options here, which you can find simply by searching Google for a solution. But in this article, I’d like to discover a tiny free tool that I found recently and it proved to be very effective. So, here we go.
Recover_MP4
Recover_MP4 is a Command Line tool. It has no GUI, so it’s a bit tricky to use the tool. But if you’ll follow the instructions bellow, you almost definitely will be able to fix your corrupted MP4 files.
- Download the tool from Restore.Media’s blog. Note: along with the tool itself, on the Restore.Media’s blog you’ll find a detailed guide on how to fix corrupted MP4 files, which I highly recommend you to read.
- Unzip the tool into a folder.
- Download the ffmpeg tool from this page. This tool will be used for combining audio and video files later on.
- Unzip ffmpeg and then copy the files from the “bin” folder into the same folder where you’ve just unzipped recover_mp4 to.
- Write down the names of your corrupted and reference MP4 files.
- Copy both video files into the same folder where you’ve extracted the ffmpeg and Recover_MP4 tools to. It should look the following way:
- Type “cmd” in the Start Menu search bar, then right click on the Command Prompt and choose “Run as Administrator”:
- Enter the folder where your MP4 files are located. For example, if the folder is on the C: drive and is named “recover“, the following is the command you need to enter (without quotes):
“cd C:\recover”
- Now, type in the following command (without quotes):
“recover_mp4.exe reference_file.mp4 –analyze”
, where “reference_file” must be the actual name of your reference video file:
- You should receive two messages along with two commands. Copy the second command mentioning “ffmpeg” and save it for later:
- Type in this command (without quotes):
“recover_mp4.exe corrupted_file.mp4 result.h264 result.aac”
, where “corrupted_file” must be the actual name of your corrupted MP4 file:
- Paste the command that you copied earlier (see Step 10) and press enter.
Your file should be fixed and saved as “result.mp4“. You can try to play the video in your media player now. If the MP4 file is still corrupted, it may be a signal of that you either used an improper reference file, or the video itself has been damaged beyond recovery. Also, there is an easier-to-use tool that doesn’t require from you to deal with the Command Prompt, but guides you through a wizard-like interface, called Restore.Media. It uses the same video recovery algorithms, as the Recover_MP4 tool, but optimized for most of the popular camera models. So, if you haven’t been able to fix corrupted MP4 files, I’d recommend you to try Restore.Media instead.