Log in

View Full Version : Replacing bad keyframes


Fook Yu
11th May 2004, 14:44
Please bear with me on this one.

I just can’t figure out why it shouldn’t be possible to replace bad keyframes.

First I have NO CLUE how a Codec is programmed. I understand “some” of the basic principles how it works, but that’s were my very limited knowledge ends.

The problem:
For what reason ever it can happen that a movie has a bad keyframe. As a logical consequence of this there is a cluster of frames that will be displayed badly...until the next “good” keyframe is reached. However this doesn’t mean that the non-keyframes are faulty they just have a faulty basis..the bad keyframe.

The solution:
It would be great if there is a filter or plug-in that could replace bad-keyframes with the previous good frame. At 25 frames per second the video screw shouldn’t be too big.

The theory:
Now the frame just before the bad keyframe is displayed correctly and this IMAGE, could be used to replace the bad keyframe. Now I do understand that the build up of a non-keyframe is completely different then a keyframe itself, however it must be possible to convert this non-keyframe to a keyframe.

I can make an image of every frame of a movie. Just go to virtualdub, type the frame number and do a print screen…Not very sophisticated, but it works.

Building on this it also must be possible to make a keyframe out of a non-keyframe and therefore replace any bad keyframe in a movie with the previous “good” frame.

The Question:
However what I understand is that non such filter/plug-in exists for Virtualdub. I really wonder why since I think that many people would find such a application incredibly useful.

Well write one yourself you say…..ok fair enough but as I said my programming skills date back to c-64 peek and poke and that’s it. I gave VB a try once but must say it was a horror. Is there anybody who can agrees with the logic??

Nic
11th May 2004, 14:49
It's a nice idea, but in most instances (to do with MPEG-4 & similar codecs) a key-frame is a scene change, so the frame before it won't be that similar (not enough to make the following P-Frames look normal anyway...and there's even more complicated reasons as to why too)...

...Also, why not just re-encode that bit of the film and attach it with VDub? Or the whole thing again? (as no codec should produce bad I-Frames now days? and if it does I don't use it)...

Unless, of course, the material is illegally obtained and the original is not owned for re-encoding...in which case no one will support such actions and hence a plugin to do what you suggest does not exist...

-Nic

Fook Yu
11th May 2004, 16:06
I know what you mean and anybody on this forum is clever enough to see the different applications for such a plugin. But what we are dealing with is a repear utility for unique material.


Anyhow, i did notice that actually keyframes are put in on scene changes, which i overlooked. It just seams so hard to believe. Is there no plugin that can be made that will replace a keyframe with a digital imagine then (gif, jpg etc. You could edit it yourself. Knowing ofcourse that quality will be shitty (sorry for word)but always better then what you have.

esby
13th May 2004, 23:27
well
define 'bad keyframes'

if it is low quality keyframe, supposing you can still decode them by a way, you could just filter, reencode (supposing you can enhance the quality in a supportable way) and reecode all the following non Keyframes based on it...

Now if you refers to 'Bad keyframes' as not decoding one.
Since you cannot decode the next ones (unless they are valid keyframes), you'll have to imagine // redraw all the frames concerned here...
Of course if you find a way to decode the part, reencoding it is like first case.

And about the legibility of that operation... I don't know, don't care here if the operation is legit or not here, what I know is that is too much work for justifying the operation...
And of course if you can reconstruct a damaged compressed (key) frame, explain us how, cause we might have people interrested...

esby

Fook Yu
14th May 2004, 01:08
Well i'm getting more and more sceptical here. I quote somebody regarding the topic:
A bigger problem is that the key frame is often used to store information besides the key image, such as video layer headers and base decoding information. A vector quantization (VQ) codec, for instance, would begin initializing a cumulative codebook, and even if you get the same image at that frame, you might end up with a differently-ordered codebook which would then cause all subsequent frames to be totally scrambled.

........

stephanV
14th May 2004, 08:49
Originally posted by Fook Yu
Well i'm getting more and more sceptical here. I quote somebody regarding the topic:


that was not somebody... that was Avery Lee :p

Fook Yu
14th May 2004, 13:22
Who's that?

stephanV
14th May 2004, 13:24
ever used VirtualDub?

Fook Yu
14th May 2004, 13:32
ohhh shittt.

Well that terminates the idea for good then.

Thanks for pointing that out to Mr. Ihavenoclue.

:D