Treasured's Movie Repair Guide -- Check data integrity with the "Zip" test

A quick way to check that a corrupt file still contains the media data, which is a necessary condition to repair it, is to evaluate its compression rate with zip utility.

Audio and video data will give a low compression rate whereas other type of data will be around 50% or higher.


Note: Treasured does this test automatically. What follows is a method to do it manually.


How to check whether a damaged movie file still contains some media data

In Mac OS X, you can use the zip utility, either from the Finder, or from the Terminal:

zip <filename>


In Windows, you can use WinZip utility.


Here are approximate compression rates you get:


There is a big gap between audio/video data and any other type of data. If you have a corrupt file, and the "Zip test" gives you a result over 25%, probably a complete repair is impossible because the data is partially or completely gone.


You can also refine the test by measuring on segments inside the file:


With a 500 MB file, we split in 5 segments of 100 MB and run the zip test on each segment with this two Mac OS X Terminal commands:


split -b 100m corrupt.mov

zip deleteme xaa xab xac xad xae


(The first one, split, cuts the file in chunks of 100 MB each, called xaa, xab, xac, xad and so on.)

(The second creates a compressed archive called deleteme from xaa, xab, xac, xad and xae.)


This gives for example:

xaa (deflated 5%)

xab (deflated 5%)

xac (deflated 12%)

xad (deflated 100%)

xae (deflated 100%)


Which tells us that the media data in last two segments is probably lost. If a repair is possible, maybe 50 to 60% of the original file will be restored.


On Windows machines, the split command does not exist.

Instead, use free software HJ Splitter to create segments out of the file. Then, with WinZip you can measure the compression rate of each segment.