I often find myself with a broken AVI video file. Either it doesn’t work at all, or it takes several seconds to begin playing, or seeking forward or backward reveals video artifacts. Here’s how to fix that broken file.
If you don’t have it, use your distro’s package manager to install mencoder, the Swiss army knife of video encoding. Then as user:
mencoder damaged_file.avi -idx -oac copy -ovc copy -o fixed_file.avi
-idx tells it to fix and rewrite the index, which should resolve the issue. -oac specifies the audio codec to use; in this case we only need to copy it. -ovc specifies the video codec to use; here again we merely copy it.
If you can’t stand the command line and simply must have a GUI application, DivFix++ seems to be the most popular choice.
Keyser’s Knowledge Base: Fix broken AVI in Linux