DIVX recovery FAQ

(Still thinking about more things to add)

 

I get a lot of questions about how I recover divx files.  I suggest you look at my CD Recovery FAQ if you have problems recovering divx files from CDs.  Once you have the file, you need to fix it so that you can watch it, hopefully without bad frames.  You also may have downloaded a file that is screwed.

 

Again I am not an expert, these are just things I have noticed as I recover files or attempt to fix screwed files.

 

First of all, we need to identify what the problems are.  Here are some of your more common problems –

· Bad/Corrupt index

· Corrupt frames

· Missing file segments

 

Note that when a divx file is screwed, most of the times these procedures won’t recover the file to a perfect state and there may be errors.  If a file is missing megs off the file size, you can’t magically make them re-appear.  You also can’t fix frames that are messed up as well, unless you want to draw a perfect picture of the messed up frame and replace it in the avi.

 

Note that an avi is made up of two important things.  The Video and Audio stream, located at the start of the file, and the index file, located at the end.  The index file takes up about .5-1% of the end of the avi file.  It provides information on the avi, and tells the player being used where to go to play a particular part.  Some players can live without an index file, but most can’t.

 

There are three tools you need to get started.  DivxFix, AVIdefreeze, VirtualDub and Gspot.

 

DivxFix – strips and re-constructs index files.  Also checks files for bad frames and tells you where they are.

AVIdefreeze – Removes bad frames.

VirtualDub – Can create divx files from most sources.  Can also be used to re-stream files.

G-spot – identifies the codec used in an avi file from its own internal database.  Can be used to tell you how much data is missing from a file, or if you don’t have a particular codec installed that is required by a divx file.

 

Whats the problem?

 

You don’t need to follow all of these steps.  Once you know what the problem is, you can fix the avi.

 

Open G-spot.  Open the messed up divx file in that program.  If the Status Window on the left reads “Truncated – xx meg are missing’, you have an unfinished download.  It won’t tell you more information than that.  If you don’t have the codec for that particular file, the status bar on the left will say “Codec is NOT installed.”  If the file is really stuffed, you won’t get any info at all.

 

Open Divxfix.  Then open the messed up file in divxfix and run the ‘Check Error’ function.  If you get something like –

 

‘Error offset: 103393364

Corrupted data detected at frame 55758 ‘

 

You have bad frames!  If you bad frames from position 1, you most likely don’t have the codec for that avi file since divxfix can’t read it properly.

 

Open VirtualDub and open the messed up file in it.  Does it open straight away?  If VirtualDub is ‘Reconstructing missing index block’, you either have NO index file or a corrupt index file.  If VirtualDub says it is using ‘Aggressive mode’, you have corrupt frames.

 

OK, now I know what the problem is, how do I fix it?

 

Missing index file

 

Open divxfix.  Strip index file.  Rebuild index.  Problem solved.

 

Missing file segments / Unfinished Download

 

Well, unless the source of the file has the missing segments, you are screwed.  Use divxfix to create an index so you can watch what is there already, and look for another copy which has everything on it.  You can’t reconstruct a divx file without the source!

 

Note that you can rebuild an index by making a direct stream copy using VirtualDub, but the index is 50x slower if there are missing file segments.  The divxfix created index is MUCH faster.  Use divxfix!!!

 

Bad Frames.

 

Open divxfix.  Use the check error function to get a report on the bad frames, and where they are.  Open AVIdefreeze.  Enter in the frame numbers into the ‘Add Frames’ area at the bottom.  Once you have a list of all the bad frames, hit Defreeze.  It will cut out the bad frames.  With some files that have a lot of errors, it may not be able to open the file.  In which case, well, you have to live with it I suppose.

 

Another thing you can do is run the file through VirtualDub to get it to remove some of the glitches.  Just do a direct stream copy for both video and audio streams and save it as another file.  Use that one from now on. 

 

Note however that if the errors are quite bad and were not cut out VirtualDub will not attempt to stream or convert anything beyond those bad frames.

 

 

Example – CD recovery and DIVX recovery in action.

 

I get a cd that someone sent me that he can’t copy anymore.  He doesn’t know quite what is wrong, but the file won’t copy.  I open up ISObuster and get it to copy the file to the hard drive.  It stops and 96% when it finds an error. I tell it to ignore the file and keep going.  It takes about 30-40 minutes to do the last 4% of the file.  I open the file in Windows Media Player (WMP), but it won’t open because it can’t read the file.  I suspect that the last 4% of the disc has been corrupted somehow, where the index is and the last 4% of the audio and video.  I replace the index with Divxfix and reopen it in WMP and see that the last 4% of the file is garbage.  However, I also notice that it is the ending credits, so I don’t care much to recover it.  I decide to keep the 96% which was recoverable and get rid of the errored part.  I close down WMP and open VirtualDub and create a new copy of the file by direct streaming the audio and video.  I notice that the file stops converting at the 96% mark.  I close down VirtualDub and re-open divxfix, stripping and replacing the index file.

 

Net result – A file with some credits cut that works perfectly and will copy, with a fast index file on it!

 

Note – This is my FAQ and if you want to use it somewhere else, ASK me first.  I may or may not grant permission but if I do, you will credit me.  If you find it anywhere else, please email me.