Roger Moore
October 2nd, 2005, 08:03 PM
File under: Hope this helps someone.
I was using DVRACK to capture when suddenly the laptop ran out of power and died. Upon rebooting I found that the video inside my DVRACK folder was still there but it was corrupt because none of the players (bsplayer, mcplayer, not even vlc) could open it, "Could not render stream". Virtualdub could not open it either: movi list missing. I tried every avi repair tool that I could find but none of them worked.
I was about to delete this file but decided before doing that - it was 2hrs worth of video - I would google around a bit, ie. procrastinate. The best info I found was at AVIEDIT's forum http://www.am-soft.ru and http://www.pk3.org/K3CCDTools/
Neither of them had that magic repair program that would instantly fix my AVI, but at least they showed me what I had to do - namely, because my RIFF headers did not get written when the laptop crashed I would have to go into the file with a HEX editor and replace the missing headers.
The best advice came from the creator of AVI Repair Tool http://www.pk3.org/K3CCDTools :
"The principle of the utility (AVI Repair Tool) is copying of good AVI header from another (good) AVI file. The source file must have the same resolution and must have at least the same number of frames (no problem to use larger AVI files).
If you don't have source AVI file, you can create it by capturing any object now."
But it won't work if you use his program because the software is buggy :(
I could open the file in Virtualdub's hex editor and see that the file was missing the movi list even after the headers had been supposedly "repaired" by AVI Repair Tool. The Tool needs some work, but the logic behind it is excellent - I followed that logic to fix my AVI.
Now here's what you need to do to repair an AVI file that is missing headers because of a crash during capture:
1. Get a Hex Editor that can 1. Open huge files (my AVI was 22 gb), and 2. Have the ability to cut and paste...Virtualdub's built-in Hex editor handles big files but it can't hilight/cut and paste across pages and pages of data. I used HexEdit.
2. In Hex editor, open the corrupt AVI in one window and open the good AVI (mine was 27 gb) in another window.
IMPORTANT STEP:
3. Copy ALL the headers from the good AVI and Paste exactly over the corresponding data (check location on the left column) in the corrupt AVI. Sure it's the wrong headers but don't worry, Virtualdub will take care of that detail later.
Save the AVI.
It's about 40 pages worth of headers, so forget about using VdB's hex editor, or else you'll be typing "01 00 EA 14 DF 69 00-30 etc." for weeks...I did the character by character replacment for about an hour before scrolling down to see the dozens of pages of headers left to go and realized...I'm still on page two.
4. Virtualdub: File/Open/extended options, open the corrupt AVI...
If Virtualdub still says MOVI list missing, go back to step 3 and compare headers from the good and bad AVI's, maybe you overlooked one line.
5. Tick on reflag keyframes, then OK
6. Vdub will start repairing AVI! Then it will lay down the keyframes (this step takes longer).
About 2hrs later it will give you the report of what it did:
AVI: Index not found or damaged -- reconstructing via file scan
AVI: Invalid chunk detected at 511589384. Enabling aggressive recovery mode.
7. Your file is back!
IMPORTANT STEP:
8. Remember to save the new AVI, if you close Virtualdub now you will lose all the changes and have to redo the recovery thing again. Use direct stream copy for both video and audio.
THE END
ps
I did all that and yet at every moment I was ready to throw in the towel and delete the file...especially after performing step 3 several times and still virtualdub kept saying MOVI list was still missing...DELETE IT NOW! Even though at no point was I convinced that I'd get the file back, I persisted for some reason, stupidity probably. Or maybe I'm a sucker for lost causes.
I was using DVRACK to capture when suddenly the laptop ran out of power and died. Upon rebooting I found that the video inside my DVRACK folder was still there but it was corrupt because none of the players (bsplayer, mcplayer, not even vlc) could open it, "Could not render stream". Virtualdub could not open it either: movi list missing. I tried every avi repair tool that I could find but none of them worked.
I was about to delete this file but decided before doing that - it was 2hrs worth of video - I would google around a bit, ie. procrastinate. The best info I found was at AVIEDIT's forum http://www.am-soft.ru and http://www.pk3.org/K3CCDTools/
Neither of them had that magic repair program that would instantly fix my AVI, but at least they showed me what I had to do - namely, because my RIFF headers did not get written when the laptop crashed I would have to go into the file with a HEX editor and replace the missing headers.
The best advice came from the creator of AVI Repair Tool http://www.pk3.org/K3CCDTools :
"The principle of the utility (AVI Repair Tool) is copying of good AVI header from another (good) AVI file. The source file must have the same resolution and must have at least the same number of frames (no problem to use larger AVI files).
If you don't have source AVI file, you can create it by capturing any object now."
But it won't work if you use his program because the software is buggy :(
I could open the file in Virtualdub's hex editor and see that the file was missing the movi list even after the headers had been supposedly "repaired" by AVI Repair Tool. The Tool needs some work, but the logic behind it is excellent - I followed that logic to fix my AVI.
Now here's what you need to do to repair an AVI file that is missing headers because of a crash during capture:
1. Get a Hex Editor that can 1. Open huge files (my AVI was 22 gb), and 2. Have the ability to cut and paste...Virtualdub's built-in Hex editor handles big files but it can't hilight/cut and paste across pages and pages of data. I used HexEdit.
2. In Hex editor, open the corrupt AVI in one window and open the good AVI (mine was 27 gb) in another window.
IMPORTANT STEP:
3. Copy ALL the headers from the good AVI and Paste exactly over the corresponding data (check location on the left column) in the corrupt AVI. Sure it's the wrong headers but don't worry, Virtualdub will take care of that detail later.
Save the AVI.
It's about 40 pages worth of headers, so forget about using VdB's hex editor, or else you'll be typing "01 00 EA 14 DF 69 00-30 etc." for weeks...I did the character by character replacment for about an hour before scrolling down to see the dozens of pages of headers left to go and realized...I'm still on page two.
4. Virtualdub: File/Open/extended options, open the corrupt AVI...
If Virtualdub still says MOVI list missing, go back to step 3 and compare headers from the good and bad AVI's, maybe you overlooked one line.
5. Tick on reflag keyframes, then OK
6. Vdub will start repairing AVI! Then it will lay down the keyframes (this step takes longer).
About 2hrs later it will give you the report of what it did:
AVI: Index not found or damaged -- reconstructing via file scan
AVI: Invalid chunk detected at 511589384. Enabling aggressive recovery mode.
7. Your file is back!
IMPORTANT STEP:
8. Remember to save the new AVI, if you close Virtualdub now you will lose all the changes and have to redo the recovery thing again. Use direct stream copy for both video and audio.
THE END
ps
I did all that and yet at every moment I was ready to throw in the towel and delete the file...especially after performing step 3 several times and still virtualdub kept saying MOVI list was still missing...DELETE IT NOW! Even though at no point was I convinced that I'd get the file back, I persisted for some reason, stupidity probably. Or maybe I'm a sucker for lost causes.