Log in

View Full Version : Any way to convert a delta frame into a keyframe?


FaustWolf
5th January 2008, 21:22
Wow, now I know why newbies can't post for 5 days -- gives them time to answer their own questions. Now that I've figured out inverse telecine and usage of Besweet for audio / video sync, here's a question I couldn't find an answer to: any way to convert delta frames into keyframes, either in Virtualdub or elsewhere?

To my understanding, with "K" signifying a keyframe and "D" a delta frame, and given the following frame order:

K D D D D D D K

...you can delete any of the n last delta frames before the following key frame and have that change locked in. However, if you want to delete, say, the two middle delta frames only, you're up the creek without a paddle -- the following delta frames somehow "re-create" the delta frames you wanted to get rid of when VirtualDub encodes again.

So, I imagine the best way to get that perfect cut is to insert a keyframe just after the delta frames you want to get rid of. For example, to delete the two middle delta frames in the previous example, you could convert the next delta frame into a keyframe as follows:

K D D D D K D K

First of all, is my understanding of how frame deletion works reasonably correct? And if so, is there any way to convert a delta frame into a keyframe, either through screencapping or some other method?

Thanks in advance!

Dark Shikari
5th January 2008, 21:27
I'm not sure how good software support is for such an operation, but note that such a thing would be impossible in any codec that supports multiple reference frames (e.g. H.264).

B-frames would also complicate such a thing.

By delta-frame, do you mean a literal delta-frame (encodes literal pixel differences), or a P-frame?

setarip_old
5th January 2008, 22:12
@FaustWolf

Hi!

Based on your references to "delta frames" and "VirtualDub", I'm presuming you're dealing with a DivX-compressed .AVI file.

If it happens to be a DivX v.3.11-compressed .AVI:

1) Load the file into VirtualDub
2) From the "Video" dropdown menu, select "Compression" - and then select either the DivX "Fast motion" or "Low motion" codec
3) Click on the "Configure" radiobutton and, in the "Keyframe every __ seconds" box, enter the appropriate decimal value that equates to one keyframe for every frame (e.g. If the framerate is 25fps, enter .04). Also set the "Data rate" to the same rate as you used for the original .AVI.

4) Save the .AVI with a new filename

You'll now have a file in which EVERY frame is a keyframe, allowing you to cut at ANY frame...

FaustWolf
5th January 2008, 23:07
Thanks guys! I'm working with an .avi compressed with the MPEG-4 codec. The quantization type is H.263. However, I still have all the source VOB and MP3 files for video and audio, so I can always re-encode with a codec that supports what I'm looking for.

Dark Shakari, I believe I'm talking about literal delta frames, as in the VDubMPEG description:

[ ]: A delta frame — stored as a difference from the previous frame. (AVI)

The frames I wanted to cut are labeled [], and not [P], so I'm assuming that means I'm working with true delta frames. I've taken the telecine out of the film I'm editing, so I think that might have gotten rid of all the [B] frames. At least no [B] frames are showing up in VDubMPEG...


setarip, do you happen to know if the DivX 6.1 codec has the same functionality as the DivX 3.3 codec? And I assume that if I convert every frame into a keyframe, I should expect file size to go way up -- is that right?

setarip_old
5th January 2008, 23:28
And I assume that if I convert every frame into a keyframe, I should expect file size to go way up -- is that right?Yes.

Of course, if your need s can be satisfied with "only" every other, or every third frame being a keyframe, the overall filesize will be proportionately smaller than making every frame a keyframe.

setarip, do you happen to know if the DivX 6.1 codec has the same functionality as the DivX 3.3 codec?That should be (as I posted) DivX v.3.11 (3.11 alpha, to be precise)I'm not a user of the DivX v.6 codec and am not familiar with its configurability...

FaustWolf
6th January 2008, 16:14
I'm seeing a "max i-frame interval" option in the XviD MPEG-4 codec. If I remember correctly, an I-frame is a keyframe; is that right? If so, looks like I've found what I need -- just have to set it so every frame's an I-frame.

Zep
8th January 2008, 04:43
I'm seeing a "max i-frame interval" option in the XviD MPEG-4 codec. If I remember correctly, an I-frame is a keyframe; is that right? If so, looks like I've found what I need -- just have to set it so every frame's an I-frame.

yes i-frame is key frame but I would not do it how you are about to do it. me I like using a fast lossless all key frames codec like VBLE then save an avi then edit that avi and then xvid 2 pass it.

IMHO xvid should only be used for the final encode because it is lossy codec and what you are doing above means you will end up having to xvid it again after editing it if you want good compression by using p and b frames.

FaustWolf
9th January 2008, 02:01
I'll seek out this VBLE codec. Thanks Zep!