“Zip test”

(Second instalment of “Movie Repair Guide”)

When confronted with a corrupt movie file, there’s a quick way to check that it still contains the media data, which is a necessary condition to repair it: the “Zip test”

We create a compressed version of the file, which tells us the compression rate. For example, 50% means that the zip file is only half the size of the original one.

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

Zip test

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 aproximate compression rates you get:

  • For data completly erased (file full of zeroes), 90 to 100%
  • For alien data, 25 to 100% (Office documents: 50%, Applications: 40%)
  • For audio integer 16, 21%
  • For AIFF, 17%
  • For DVCHD Pro, 11%
  • For DV, 5 to 12%
  • For other video codecs, DivX with mp3, Intermediate, MPEG2, H264, JPEG: 0 to 8%

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 500mb file, we split in 5 segments of 100mb 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 100mb 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.