On Tue, Dec 20, 2005 at 10:13:01AM +0100, Martin Samuelsson wrote: > On Mon, 19 Dec 2005 18:20:56 +0100 > Bernhard Praschinger <[EMAIL PROTECTED]> wrote: > > Lavtools, avilib, or something, likes to write an empty RIFF header > when beginning and recording an avi file. If there is a sudden or > unexpected crash, the header tends to remain empty, as it is one of > the very last things to be written when lavrec exits. > > > I have no idea how to generate a AVI header. Maybe you find > > something in the mailinglist archive. > > If one's determined to make a broken file work, one could modify > and use the header from another file in the batch. You'd have to > read up on the RIFF specs (easy, really) and manually go through > some tedious calculations, but it certainly is possible. > /Sam
Actually, it's not that tedious, and no calculations are needed, at least to get enough of a header to make one of the "lav" programs (lav2yuv for example) to read the file. I did it several times myself when I would have a recording crash (or more likely the box crash, the initial system I was using turned out to be not that stable). I don't remember the exact value, but all that was needed was to copy either the first 128 or first 256 or first 512 bytes from a working .avi file on top of the front end of the non-working .avi file. I usually did the "swap" with judicious use of dd for spliting headers and bodys apart, and a simple cat to combine a working header with the otherwise non-working body. The source .avi for the working header needs to be the same settings (resulution/etc.). Since I usually had multiple files from a single recording session, I simply extracted a header from another .avi recorded in the same session. If one has only one single .avi, it's much more difficult. Making another test recording with the same resolution settings in theory should work, but I never had the need to create a header, since I just picked one up that was working in another file. However, the resulting file, while working enough to recover the data, does not work perfectly. Lav2yuv would "process" on the file for a real long time before outputting anything. I suspect it was reading through the whole file for some reason before outputting anything. ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Mjpeg-users mailing list Mjpeg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mjpeg-users