Tuesday, March 9, 2010

fixing munged avi

recently i had to patch up an avi that was cut off in the middle of recording my desktop (with camstudio for windoze). the movie file it produced had data blocks, but there was no file or stream header and the first 2048 bytes were 0.
i managed to get it limping by recording a 10-second avi with the same software and transplanting that file's header onto my 2.7gb waste of time, with dd:
dd if=good.avi of=header count=4
dd if=noheader.avi of=tmp skip=4
cat header tmp > withheader.avi
probably a faster and more disk-efficient way, but i'm lazy like a good engineer should be. my mplayer doesn't like any of camstudio's avis, but vlc will play this frankenstein as long as i select 'do not repair'.

No comments: