Mark Oliver's World

Video Data Recovery From A Formatted SD Card

17/08/2024

Recently my partner has started vlogging. This meant a new camera was purchased specifically for the job.

We went away from home for a few weeks, which meant no access to the normal video editing / backup options, so while we were driving, they decided to plug the camera into their Android phone via USB to extract the videos so they could edit them on the phone.

The phone is Android, and the Camera SD card is exFAT.
These are incompatible.
So when the phone recognised the USB device, it offered the option to "Format" the SD card so it could be read by the phone.

Now I know most of you reading this are crying out "STOP" at this point in the story. Which is exactly what they should have done, but I am afraid that is not what happened. Clicking that "Format" option lost over a week of video footage.

Cue lots of swearing and crying.

We were luckily enough to have another SD card around, so they swapped to that and we left the original card alone, knowing that data recovery is an option.

When we returned from our travels, this is the process I have gone through to try and recover the data.

Set expectations

Firstly, I wanted to set the expectations with my partner. Basically I said "The chance of retrieving any usable video data is minimal"

The data although valuable to my partner is not worth anything, so the data recovery process had to be zero/minimal cost.

Extract files from formatted disk

Firstly, I had to recover the physical files from the disk if they were still available.
I googled for some data recovery tools, and tried these 2 tools with reasonable success.

  • DMDE Mostly free, but has paid features when a lot of data needs recovering
  • PhotoRec Free, but donations are encouraged

Both retrieved the files I expected.
DMDE had more options, and a deeper scan, and the recovery maintained the original file names.
PhotoRec was simpler to use (close to a one-click), but it did not maintain the original file names. It did seem to recover images better though.

Neither of the tools could save the MP4 files though, they were all corrupted in some way and could not be played back. A further recovery step was required.

Note - Not only did the tools recover the files that were on the disk at the time of format, but they also recovered some files that had previously been deleted (although not needed, it was nice to see!).

Video File Recovery

The video files as they were have now been retrieved from the Formatted disk, but they were no longer valid files and couldn't be played back.

There are loads of tools out there to do video file recovery, but the "best" ones need 2 sets of input; The corrupt file and a good sample video file recorded on the same device.
This is because it uses the sample file to determine the parameters of the corrupted file, such as encoding, resolution etc. It means the guess work is reduced, and there is a higher chance of the final recovered video being usable.

One problem specific to my situation though, is that my partners camera can record in "portrait" or "landscape", so the resolution changes dependant on which setting is used. Because of the data corruption, there is no way to know which recovered file is in which format, so this is going to require some experimentation, and most likely to recover them twice (once with a "landscape" sample file, and once with a "portrait" sample file!)

The only tool I found that managed a level of recovery of the video files in some way (lots of frame loss) is this one:

The advanced repair mode (which required the second sample video) is the option that worked, and recovered (in some way) 90 video files within a few hours.

Quality of recovered data

The video data recovered is either a perfect video (mostly very short videos), or it is full of artifacts caused by missing frames of data.
The audio is generally unaffected, but the video part is problematic.
Some videos are clearly too short, being truncated.

Lessons I learnt

There are lots of ways to recover data, and the free tools stood up well.
Large video files are harder to recover than small files or images.
FFMPEG drives everything to do with video manipulation.
Users get given administrator level options without explanation of the impact of the choices being offered on consumer level goods.

Lessons learnt by my partner

Ask for guidance if you don't know what something means.
Split your recordings across multiple SD cards, to limit data loss from corruption.
If in doubt, DON'T PRESS THE BUTTONS!
Your partner is amazing and a technical wizard 😉


Thank you for your time.

If you want to reach out, catch me on Twitter!