| Printable Version of Topic
Click here to view this topic in its original format |
| Unofficial VirtualDub Support Forums > Newbie Questions > Avi File Format Hacking |
| Posted by: Rikki Sep 4 2002, 04:22 PM |
| Hi everyone, Firstly Id like to say a big thanks to "the man" for creating VirtualDUB, its a truely awesome piece of work and I cant believe how much functionality is enclosed in such a small piece of code! Right onto my woe ... I got myself a really cheap WinTV PCI capture card to grab some footage from an 8mm camcorder, since I now have a firewire DV cam I had sold my old decent analog capture board. So I installed the latest Hauppauge drivers and the thing wouldnt do much so I installed the GPL Bt878 drivers from SourceForge and things got better. Still virtualdub wouldnt capture properly so I used a very very basic prgram that was mentioned in the GPL drivers called AMcap. This worked, thankfully. So I went about capturing about 50gig of footage raw uncompressed and have since cut the files into smaller pieces (about 200 of them). Went into VirtualDub, opened one up and went to append it to another ... Argh! Not 25 frames per second as expected, 24.995 fps!!! So I then set the file to be 25 fps and save it and compare the headers, I noticed that there are changes at offset 80h and around 20 or 40h as well. I tried doing a google search to file a breakdown of where the offsets are in the AVI RIFF header but didnt turn anything up. What I want to do is create a little assembler patcher program that goes through all the 50gigs of AVIs and just pacthes the header on each so they will all be exactly 25fps, I could load them into VDub and do it manually but come on its 50gigs of data!!! Any help on this one appreciated. Thanks Rikki |
| Posted by: Ciler Sep 5 2002, 06:33 AM |
| Here are some things you could have a look at : - Fisrt, in Virtual Dub and launch the "Hex editor" in "Tool menu". Throw one of your file into it (menu "Open") and have a look at its RIFF chunk tree (Menu "Edit" or Ctrl+r). This should give you several hints on your file's structure. - Framerate value is stored into 2 different locations by the mean of two different values. The easier for me is to suggest you to have a look at MSDN doc herehttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcedshow/htm/_dxce_dshow_avi_main_header.asp (AVI file header) and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcedshow/htm/_dxce_dshow_avi_main_header.asp (AVI stream header). This should be a good start. However, there's another thing you can do. Just set up VDub to change framerate for one file, but, when launchin "Save as AVI", click "add operation to job list and defer processing". This will create a job file for Virtual Dub. Now, open it (VirtualDub.jobs) and do some copy & paste changing file names. Then launch VDub, go to "Job Control", hit "start" and face the job going around. This might be safer than hacking right into your files (if ou still retain this method, I suggest you backup then before starting patching) |
| Posted by: Rikki Sep 5 2002, 11:23 AM | ||
Hi and thanks for the info. I actually found a little program called AVIfrate on doom9.org which did everything for me, and without the need to process the whole file, it just patched the header. I'll still have a look at the links you posted as I would like to learn more about it. Thanks again. |