View Full Version : Filter for recreating AVI index blocks?
moko
23rd February 2003, 21:51
I though about a filter that I think will be great but I don't know if it can be done: doing some kind of a source filter for incomplete avi files or files missing the index block (like Avi Preview or VDub). I thought of this after my friend downloaded a movie for me and it was missing the index block so I used vdub (avi preview failed for some reason) to reconstruct the file but the keyframes were all messed-up and anyway the file needed some editing (had bad aspect ratio), and I thoght that avisynth can be really great for it. So, does anyone think it can be done?
esby
7th March 2003, 13:20
Being efficient in the main problem in programming...
I think having a filter to 'reconstruct' aviIndex is an error,
unless you already reconstructed this index somewhere in another file.
Vdub can reconstruct the index, actually, i won't say the method is bad or not, but porting this method into a filter will have to force you to wait 10-15 min before doing anything of your avs i think.
If your problem comes from a downloaded file, try to resume it.
Or patch it. For this last you can use!
Zidrav
Rfix.
(both are sourceforge project and search google... )
For files got on newsgroups you can use pars files...
I think it is faster to fix the file directly than to have a process reconstructing them, and maybe with errors and with a cost of (programming) and time...
esby
sh0dan
7th March 2003, 17:47
There is not much idea in simply duplicating something that Vdub is very good at.
- Open the file in vdub, with re-derive keyframes.
- Wait!
- Save the file as a new AVI file, using Direct Stream Copy.
- Open the new file in AviSynth.
ErMaC
9th March 2003, 08:11
However then comes the issue of what happens when the AVI file is a multigigabyte AVI file and you don't have enough hard drive space. Since from what I understand, AVISource uses the VirtualDub AVI Reader code, why not just add in his index-recreator as well and have it callable with IncompleteAVISource(), where when the file loads it recreates the index. Now obviously there'd be no way to show a progress report like VDub does, but it would still be useful to some, I'm sure.
Xenoproctologist
17th March 2003, 01:55
Simpler implementation -- treat it like DirectShowSource.
AVISource(clip filename,boolean "IgnoreHeaders")
If (IgnoreHeaders == true) {
Assume the first frame is the only keyframe.
Disable backwards seeking.
}
esby
17th March 2003, 02:14
The simple implementation may work, but i don't think it'll be really useful.
If will be a little like in those old time,when you got a corrupted rm file,
and if you tried to seek in it, you were 'dead'... Meaning the player blocked to death, and you could only go to the start of the clip and pray...
What i mean is that: What the uses of this filter?
If it is for allowing playback of non complete avi,
it may work but at the condition the user doesn't request backward or fast advance,
because fast advance will force the filter to compute each frame from reference point to the wanted frame.
In this process if the file is corrupt you'll probably crash the avs.
If your purpose is reencoding or rekeying, vdub can do that already,
and with better chance of success.
If you don't care about seeking, just rebuild the index, according to the tag structure, the operation is short in time.
If you need fast access, rewind, etc, you need to rederive all keyframes, and the process is longer.
And there will be noway to reduces the time process by porting this algo in avs, and as ermac said, the no process bar could be painful.
esby
Richard Berg
17th March 2003, 04:40
@Xeno -- it's not really possible to disable seeking. The client app is what determines which frames are requested & when.
ErMaC
18th March 2003, 09:27
Richard - but what AVISynth can do is what it does with Directshow source - return a frame with Video DeSync at the top. In this way backwards seeking is "disabled" for all intensive purposes.
I still don't see why this is a bad idea per se. To answer Xeno's argument, sure VDub can 'process' the files. But then to actually do anything with them in AVIsynth you have to dump it back out to a new file (doubling the HD space required for your operation) or only use VDub's internal processing/filters.
Now I can see a major problem though - what happens when you use a filter that requests frames out of order? Could get very messy.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.