CFexpress video recovery with a custom-built algorithm

Generated Python code illustration for the CFexpress video recovery case study

The computer asked to format a 128 GB Delkin Devices CFexpress card. The videos on it were still needed. Recovering usable footage required more than retrieving files: we developed a locally running Python application with a custom recovery algorithm.

286–287 of 288 videos became usable.

Only 1–2 recordings remained unusable. That is over 99% by file count, not a recovery percentage measured by data volume.

When the footage exists but will not play

A video file contains more than pictures and sound. It also holds structural information that tells a player how to handle the recording. If that structure is damaged or incomplete, a video may fail to open even when much of its picture and audio data is still available.

Think of a book whose pages survived but whose binding and contents have become disorganised: the material is there, but it needs to be put back into a usable whole.

In this case, simply retrieving files was not enough. The goal was to make the videos playable, editable and suitable for archiving again.

Delkin Devices POWER 128 GB CFexpress card received for data recovery
The actual storage device. Select the image to view the full photograph.

What made this recovery distinctive?

Making the recovered files usable required a targeted solution. We built our own Python application to process this particular material locally using a custom algorithm. Its processing stages can be paused, stepped through and stopped.

The approach compared the structure of suitable intact reference material with the recovered files, then rebuilt usable files from the available intact video and audio streams. We preserved those intact streams without lossy re-encoding. This was about retaining the original recording quality, rather than enhancing it after recovery.

Illustrative Python code with colourful syntax highlighting in a dark code editor
Generated illustration, not the application’s actual source code or a screenshot of the software.

Technical background

Reference-based video reconstruction

File-system accessibility and the integrity of a video’s internal structure are separate questions. A format prompt alone does not establish a controller or NAND failure. Recovered files also need to be assessed to determine whether their container structure and media payload can support further processing.

Main stages of the targeted processing workflow
StageAssessment or operation
Structural analysisExamining container and header structures in the recovered files and comparing them with suitable reference material.
Custom algorithmImplementing processing tailored to these files in our own locally running Python application.
Stream extractionExtracting available intact video and audio streams bit for bit, without lossy re-encoding.
ReassemblyCombining the extracted streams with the necessary structural information to produce usable video files.
Usability assessmentDistinguishing an accessible file from a successful outcome: the usefulness of the recovered recordings matters.

Why avoid re-encoding?

Re-encoding video can introduce additional quality loss. If intact, already compressed streams can be placed directly into a correctly constructed container, this step is unnecessary. The method cannot recreate picture or audio data that is missing or irreversibly damaged. The remaining 1–2 unusable recordings also demonstrate the limits of recovery.

The outcome: usable footage again

Of the 288 videos, 286–287 became usable. The distinctive part of this case was the application and algorithm developed for the particular problem, reference-based structural reconstruction, and preservation of intact streams without additional quality loss. This is not a universal fix for every damaged video: the available data determines what can be recovered.

Other devices

Blog