PDA

View Full Version : Corrupt avi help


ErnstHot
03-21-2006, 09:56 PM
While shooting a timelapse sequence of a sunrise, I ran into the 4 Gb size limit to avi files, thus I've got all the data, but the header (I asume) is corrupt. I know a bit of programming and could probably write a python script to extract the data, but I'm not used to dealing with file formats in this way and was hoping that perhaps I can just fill in the blanks in the avi.

So anyway what I'm asking is, if any of you have anything to say that would help me deal with this?


Thanks,
Thorsten Ørts

wild-paradox
03-24-2006, 05:47 PM
My suggestion would be to just search the internet for a shareware version of an avi program. Im sure this is a common enough program that there is already a solution to it. Good luck.

Segmoria
03-24-2006, 08:00 PM
The 4GB file size limitation doesn't have anything to do with AVI files in particular but is purelly caused by Windows due to the FAT32 filesystem's inabillity to address pointers larger than 32bit.
Furthermore your video is not corrupted, your filesystem just has problems accessing it.

You can try opening it with VirtualDub, and you can also use the same program to chop the video into small chucks.
http://www.virtualdub.org/

ErnstHot
03-30-2006, 03:57 PM
That was what the capture program I used said, but you're right it's a FAT32 disk and I should have thought of that in advance :/ Anyway, the file contained no headers, no nothing except the first frame header and the actual data, so i wrote this python script to extract the data, and here it is, should anyone need it:

import sys, os, struct

infile = open("f:\\kunst\\TimelyOrder\\TimeLapse.avi","rb")

while 1:
data = infile.read(4)
if data == "00db":
print data,
for i in range(0,4660):
data = infile.read(4)
data = infile.read(640*480*3)
print "Writing file %d" % (i)
outfile = open("frame%.4d.raw" % (i),"wb")
outfile.write(data)
outfile.close()
data = infile.read(4)
break

infile.close()

You might need to replace 00db in if data == "00db": with whatever header is used in the file. Also it only works for uncompressed AVI's with no sound... No time to make it userfriendly either, which also means it writes RAW files, sorry :)

Use at your own risk.

ErnstHot
03-30-2006, 03:58 PM
Oh, and thanks anyway :)

CGTalk Moderation
03-30-2006, 03:58 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.