That’s a tough work, but someone has to do it, right? I learned by myself, by errors after errors.
I’ll make you laugh: at first, when I discovered what great tool was VirtualDub, I used it to delete the stuck frames and then recompress the whole movie losing quality. This took dam long, I assure you. Then I discovered I could delete frames, and save the file without recompressing, kewl! But right after that I also discovered (the first movie which could take advantage of this has been Pulp Fiction) that Premiere could actually read those frames… so I just cutted them, pasted in a new clip, recompress them to make them compliant with the normal codec, and then re-past the recompressed, working clips into the stream. Woo that WAS kewl, I could keep all the movie, in better quality than I had by recompressing the whole video, and all this in half the time!
…until I read Doom9’s (www.doom9.net or doom9.go.to) guide to fix DivX, and I discovered the existence of some nice tools which did it for free, and really fast, that is AVIDeFreezer and DivFix.
All the tools explained in this article can be found in the Downloads/AudioVideo section of this website.
Follows a guide to AVIDeFreezer which you can find also in the ZIP in HTML format (this is just a copy/paste, with minimal adaptations, the intellectual property of this guide is of the software’s author.
1. First open VirtualDub and click "Open Video File" in the File menu.
2. When you have opened the file, use the slider to get near the place with the bad frames, then click play. When the program gets to the bad frame it will give you an error like below.
3. Now click previous keyframe, and make a note of the frame number, this number should be entered as the start frame in the AVIDeFreezer.
4. Now click next keyframe untill you get to a working frame, normally this should be the first keyframe, but sometimes when a movie is really messed up they can be more. Make a note of this frame number too, this will be used as the end frame in the AVIDeFreezer.
5. If the movie has more than one segment with bad frames return to 2 and do this for every corrupted sequence.
6. When you have found all bad frames start AVIDeFreezer.
7. First open the original file and choose a location for the new file, don’t try to overwrite the original file, since that will cause problems. Also be sure that the destination folder has enough space to contain a file about the same size of the original movie.
8. Now enter the start and end frame for all the corrupted segments you found using VirtualDub (this example is a version of Wild Things, this movie had 5 bad frames).
9. When you have entered all the intervals click DeFreeze and the program will start working, the first part where it fixes all the bad frames is pretty fast, but when it gets to "Writing Streams To New File" it will work for a while depending on the size of the movie and the speed of your harddisk, this is because it is copying the original file to the new file, except for the bad frames which are now fixed.
10. When the program has finished writing the new file it will crash and close itself, but don’t worry the new file is ok and working.
11. When you watch the movie the frames that where bad before may have some small errors (see below), but they won’t freeze anymore, and you didn’t need to cut them out.
But not every tool is prefect. So, when some DivX’s won’t get fixed with VirtualDub/AVIDeFreezer (and this can happen if the movies are encoded in VKI – Variable Keyframe Interval, or if the movies you downloaded are incomplete, since the server closed, and you got noone else to resume from, VirtualDub will begin to "guess" frames till the end of the file, unless it finds a corrupted one, which will mean you won’t be able to go past that frame with VirtualDub, and the movie will seem definitely lost.
But you have a last hope, and this is DivFix, which worked with every movie I tried it on, showing its flexibility as a great tool, unless you want to edit the "corrected" movies so obtained with VirtualDub, since it won’t be possible. This is because DivX have an "index" at the very end of the file, which is used by players to gather info about the file and reproduce it correctly. If the download is uncomplete (so missing the index), a player won’t be able to read that movie, but VirtualDub can guess te frames as I said, until a corrupted frame occurs, and VDub stops searching for other frames (too bad) truncating the movie at the first corruption. DivFix creates this index, working on the existing frames, apparently no matter how many of them are corrupt, so allowing every player to play the movie with no freezes from the first to the last downloaded frame, with obviously some reproduction artefacts in the video stream, as snow, weird colour wakes, and so on, in the corrupted frames. But this newly-created index is not recognized as valid by VDub (I really don’t know why), which will try to guess frames from the beginning, getting stuck at the first corrupted frame as I said.
Make a backup copy of the AVI just in case, then open it inside DivFix and press the Rebuild Index button, that’s all.
A tip for habitual users of DivFix: under Win2k/XP you can add DivFix in the contextual menu "Open With >" for AVI files (just for DivFix 1.06; right click on the file in Windows Explorer), so you won’t need to start manually the program: right-click on the AVI you want to fix, in "Open With >", click on "Choose Program…" and browse to your DivFix location, then double click on the divfix.exe file, being sure that "Always use the selected program…" is disabled. DivFix will open, fix the file, and close; from now on, you’ll be able to choose DivFix from "Open With >" everytime you have an AVI to fix.
This is all I know about the matter. Actually not everything, but you can easily guess the details I omitted .
Last update: I noticed (and while I am adding these very words, I had the confirmation elsewhere) that using the DivX4 codec (nothing in relation with DivX3.11, but the name, and the backward compatibility; dowload it from Downloads/AudioVideo) to playback also DivX3.11 movies, freezes will be simply ignored, and you will be able to continue the playback normally (getting anyway those artefacts we talked about before). Even in this case anyway, if the index at the end of the files is missing, you’ll still need DivFix to re-create it. ThePlaya, the DivX player included with the full bundle of DivX4, and which you’ll find also here, is capable of playing index-less DivX 3.11/4 files, yet it never worked fine for me, since the playback was choppy, and then again even worse than choppy.
There’s nothing in here such "How to fix your corrupted movies by redownloading only the corrupted segments", which is still an important part of the official guides to fixing DivX’s. This is because it often (c’mon, let’s say "always") happens that you do NOT have the opportunity to ask the guy running the server to install the utility-they-need-to-check-the-CRC and please-run-it-for-me-cuz-otherwise-my-movie-won’t-play-well-pretty-please. Only two people did it for me, and they were my friends . Anyway, if you still want to try and compassionate someone into helping you this much, you can find the utilities I am talking about in the Downloads/Internet section, they are named Rsync and Zidrav (stick to the second if you want my opinion).