AVI Repair :(


Recommended Posts

I've made a recording with BB Flashback express. Due to issues in the past with large files the software is configured to split it into 1GB files during the recording process. I use the batch export tool to convert the files to avi format using xvid. The intention is to then append and crop with virtualdub.

The problem is that occasionally one or two of the avi files after exporting seem to have broken headers and I'm trying to figure out how to fix them. (Re-exporting makes no difference). They won't play in VLC, yet play perfectly in MPC. Opening these broken files in virtualdub results in an error "Invalid AVI file: The main 'movi' block is missing".

I tried:

  • Replacing the headers manually from one of the other avi files with HxD and used the "Re-derive keyframe flags" extended option to hopefully rebuild it correctly, but it didn't work, the resulting video consisted of solid green frames. I could easily have done this wrong though, since I have extremely little knowledge of the format...
  • Installing 'super' to do a conversion to see if that'd fix it, but I can't get it to install, I get an error when the installer it tries to download something :angry:
  • Using AVIFix or whatever it was called, but that just gave an error about not finding the movi block.
  • Using AVIRepair, which apparently replaced the header with one from a known good file, but I get the same 'movi' error opening it in virtualdub afterwards.

The video and audio data is clearly there and intact since it plays perfectly in MPC, I just don't know how to repair the headers so it'll open in virtualdub...

Can anyone please help me? (The one thing I can't do is send you the file, sorry, it's personal!)

Link to comment
Share on other sites


I first tried to solve this a few days ago and failed, now with some further analysis using virtualdub's hex editor's "RIFF chunk tree" viewer I've managed to somewhat better understand the container formatting and I've solved it!

With all of the "good" files there's a JUNK block between the header and movi blocks, which consists of four bytes representing the characters JUNK followed by four bytes describing length followed by the junk content. With the broken files there's simply two bytes representing the letters JU and nothing more, it immediately starts the movi list block after this, i.e. it's screwed up. I fixed this by copying the rest of the junk block from a good file, and adjusting the bytes near the beginning representing file size. I'm now allowing virtualdub to repair the index.

I'm very happy now :)

Link to comment
Share on other sites

This topic is now closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.