Articles Technology Blog News Company
Recover Corrupted or Accidentally Deleted Video Files
Imagine a situation where you spent hours in the field, filming a video for a client or shooting a lovely corporate video, only to find that the recorded video files won't open.
Disaster, isn’t it?
While this is quite a rare case, it usually happens when you expect it the least.
To restore the footage, you have two options:
1. Shoot the video again, which can obviously be quite costly.
2. Try to recover files using a video recovery software or ask a video engineer for help.

In this article, we'll talk about how video files can get corrupted, how to recover them, and how to avoid similar disasters in the future.

Repair Video Files


1. Common Causes of Damaged Video Files

1.1 Interrupted Recording

Most of the common types of video files such as MP4, MOV and MXF are implemented as data containers. They usually include a video stream, an audio stream, and metadata. Some of them may even contain multiple video and audio streams encoded with different codecs.
Although the structure of different types of video files differs, they all include a metadata section, often referred to as a file header.
Metadata includes important information about the video and audio streams contained in the file, such as frame rate, bit rate, codecs, timestamps, resolution, etc.
When recording video, the camera collects metadata in internal memory and then saves it at the end of the video file when you complete the recording process.
And this is where the problem can arise.
If the recording process is interrupted unexpectedly for any reason (such as a power failure), your camera may not transfer the metadata from its temporary memory to the main media on which the video file was recorded.
As a result, you end up with a file that contains recorded video / audio data but lacks the metadata.
Now, metadata is absolutely essential for media players and post production software to read video files. You won’t be able to open an MP4 or MOV file if it has no header or the header is damaged.
But why don't cameras save metadata at the beginning of the file?
The answer is – this is impossible. You see, metadata contains details that can only be collected after the recording process is complete. Only then can the camera calculate the length of the recorded streams, their size, number of frames and the location of time stamps.

1.2 Accidentally Deleted Video Files

This is the second most common cause of video file corruption.
You may already know that there are data recovery applications (also known as “undelete” tools) that allow you to recover deleted files.
However, when it comes to recovering deleted video files, things get a little more complicated compared to other file types. This is due to the large size and complex structure of the video container file types.
Data recovery tools often struggle trying to find all parts of deleted video files that are usually scattered around the media due to fragmentation. And building the recovered data into a valid video file is another challenge.
After recovering an accidentally deleted video file, you may find that the file does not play.
If you’re lucky, such a file will contain entire video and audio streams. But quite often the recovered video files lack the header (metadata) section, so you cannot play them.

2. How to Repair a Corrupted Video File?

2.1 Fix File Header

If you have a damaged video file, the first thing you need to do is check its size. If it is less than 100KB, there is no video data and there is nothing to recover.
If the file is of a reasonable size, chances are good that the recorded video is still there and can be recovered.
All you have to do is to try to fix the metadata in the file header.
There are many tools that can do this for you, such as Restore.Media, for example.
Here is how it works:
  1. First, you upload a corrupted video file.
  2. Next, you will most likely be asked to upload a sample file. This is a valid video file recorded with the same camera and settings as the damaged one. Video resolution, frame rate, bit rate, codecs, etc. in the sample and the damaged files must match.
  3. The tool will extract the necessary metadata from the sample file, build a new header based on it, and then place it at the end of the corrupted file.
Voila, your file should now work fine.

2.2 Recover Deleted Video Files

Unfortunately, things can get more complicated if you need to recover an accidentally deleted video file.
As we already know, video files have a rather complex structure, and data recovery applications often fail to properly collect and merge all the deleted video data into a valid file.
Since there is a high risk of losing the entire file or a part of the video, we recommend following these steps:
1. Once you realize that the file has been accidentally deleted, do not allow new data to be written to the medium.
This is important because new data can overwrite the remnants of the deleted video file.
If it is an SD card, we recommend locking it using the security switch located on the side of the card.
2. Now you must create an image of your entire media. This should be a full RAW bitmap that includes data from clusters of free space because this is where the deleted video is likely to be.
3. Having a RAW media image, you can experiment with different data recovery tools and services to see which works best.
Not all "undelete" tools use the same data recovery algorithms. Quite often, recovered video files contain junk data, lack video frames, or even large portions of the video stream.
When recovering a deleted video file, we suggest trying applications such as FileScavenger, R-Studio, UFS Explorer and ReclaiMe.
If these tools don't work, manually processing the image file can help.
4. Finally, after recovering the deleted video file, it may appear that you still cannot open it.
This is because the video file container was not restored with the correct structure and the header is missing. Fortunately, this is easy to fix – see Section 2.1 above.

3. Preventing Damage to Video Files

While there are applications and services that can help you recover video files, it’s not 100% guaranteed that they will work with your specific files.
Therefore, it is a good idea to follow these simple rules to keep your footage safe:
1. Always remember to end the recording session before turning off the camera.
2. Avoid recording video when the battery power drops below 5%. Sometimes the battery gauges are not very accurate and the remaining battery power may drain much faster than you might expect. This may result in a power outage while recording. And you want to avoid this scenario at all costs.
It’s also a good idea to have backup batteries with you.
3. Use storage devices from trusted hardware vendors. This is especially important when choosing a flash memory card such as SD. Make sure your storage device has sufficient capacity and write speed to support the transfer rate provided by the camera.
Some camera vendors even have a list of certified storage vendors and specific media models that are compatible with their cameras.
4. It’s a good idea to keep the firmware of your camera up to date.
But we also recommend that you check the vendor forums for any issues that may arise with a particular firmware update. Don't be the first to test the most recent update. Wait a couple of weeks to see if there are any complaints about the firmware update before installing it.
5. Make a backup copy of your footage before editing.
6. If you are going to shoot a video for a client, we recommend quick-formatting the media to reduce the fragmentation of the video files written to the storage.
7. If you accidentally delete a video file, avoid writing new data to the media at all costs.
For SD cards, it is recommended that you safely remove the card from the camera immediately after accidentally deleting a file.
Once removed, lock the SD card with the safety switch. Some operating systems write temporary files to the card when you insert it into the card reader. Locking your SD card will help to avoid this scenario.
8. If you can’t open the video file, do not rush to delete it. There is still a chance that the video data remains in the file and can be recovered with video recovery software.
So, this is a guide on how to recover your video files and avoid losing your footage in the future. Take care of yourself and shoot safely!

Other tutorials...