Log in

View Full Version : Add Keyframes for chapters


Nemesis7
18th September 2002, 22:28
How can I add keyframes to specific points in a movie (just avi, no sound), coz when I use the chapters and there are no keyframes, it goes to the next keyframe and is not in the beginning of the chapter, suxx pretty much.

I can re encode, is 12 Meg.

It's the bloopers thing of episode 2, if funny.

Peace.

P.S. The movie is in DivX 5 and the audio is OGG.

Suiryc
20th September 2002, 11:46
You can also try to disable the "Seek on keyframe" property in the OggDS filter.

[Toff]
20th September 2002, 12:55
You need to reencode.
You can try with AVIUtil which can force keyframe but you will have to add each key frame by hand.
Maybe it's possible to modify the Divx5 log file to force keyframe on second pass.

squalo
20th September 2002, 13:01
Hi, I have the some problem time ago, and my way of solve this was:
cutting the avi in virtualDub at the points when I want the keyframes,using the direct stream copy, and the when I have the whole chapters in diferent avi´s. joined the files again using the directstream copy too, and "magicaly" there are keyframes at the start of every chapter. I dont know if there is a easy way to do this, but if is for a little video there is no a hard work to do.

Acaila
20th September 2002, 13:38
Why not check the movie to see where the keyframes are and editing the chapter timecode so they coincide instead of the other way around?

Bluedan
20th September 2002, 14:27
@squalo The method you described holds no magic. If you disregard keyframe (=I-frame) positions when cutting, so that the resulting 2nd part had some p- or b-frames in the beginning, these non-keyframes are simply dropped. The reason is simple: the decoder needs a keyframe to start with, because only (!) keyframes contain the whole image information. So in your case after remerging you may notice a slight glitch or the like because of the missing frames. If it was merely up to 10 frames it's possibly not disturbing for you.

@Suiryc Squalo is talking of AVI containing DivX video. Even with OGG audio in external use OGG-DSF is not involved with video seeking.

Personally I do exactly as Acaila proposed. If the next keyframe is too far away (lack of scene change or max I-frame interval set high during encoding) I leave it uncorrected.
Anyway this should be no problem with your DivX-avi. The renderer should jump right on that frame you point to. If it's not an I-frame it takes some time ,depending on your machine power, to calculate that frame from the preceding I-frame.
Only with OGM-container (and proper DSF) you can force the video-renderer to stick to keyframe positions.
I think this an exhausting explanation.

Suiryc
20th September 2002, 17:11
Originally posted by Nemesis7
coz when I use the chapters and there are no keyframes, it goes to the next keyframe and is not in the beginning of the chapter, suxx pretty much.
Originally posted by Bluedan
Anyway this should be no problem with your DivX-avi. The renderer should jump right on that frame you point to. If it's not an I-frame it takes some time ,depending on your machine power, to calculate that frame from the preceding I-frame.
That's why I thought Nemesis7 was talking of an OGM file.
If this is not the case please excuse me, my post is of no help here.

Nemesis7
21st September 2002, 04:55
Why not check the movie to see where the keyframes are and editing the chapter timecode so they coincide instead of the other way around?

Well I extracted the chapters and it just should go to that timestamp, whatever frame that is, and if i adjust it to go to a keyframe, the whole idea of chaptering is messed up.
So I need it at that specific frame. I want to add keygrames but dont know how (AviUtil is all Japanese i think, some1 xplain how to correct that?, I did download the extra filters and so)

That's why I thought Nemesis7 was talking of an OGM file.

I am talking about an OGM file, my bad. So its A DivX 5.02 encoded video with OGG sound, in an OGM conatiner.

You can also try to disable the "Seek on keyframe" property in the OggDS filter.

I tried but, but freezes until the next keyframe, so still no use. :(


And I tried to cut into pieces and rejoin, didnt work either.

Please help me out.

P.S. Explaining how to add keyframes would be pretty good. If possible without re-encoding. Thnx.

[Toff]
21st September 2002, 15:52
Explaining how to add keyframes would be pretty good. If possible without re-encoding. Thnx.

You can't add KF without reenconding.
Here is the procedure to use with AVIUtil :
1. Download & unzip aviutl98d.zip from Doom9
2. To use english, choose in the first left menu, the menu item just before the last item. You see a submenu with the text "(Language)", click on this one. Then choose english in the combo box, OK and restart AVIUtil.
3. Open your file
4. Goto a chapter frame "Edit->Go to specific frame (Ctrl+F)"
5. Force KF "Edit->Set current frame as keyframe (Ctrl+K)"
Do 4 & 5 for each chapter.

Another way is to create a text file with the list of KF :
426
489
..

And then use "File->Import->Keyframe list"

Nemesis7
22nd September 2002, 00:38
Thnx [Toff]!

It works!2 Bad I had to re-encode, coz I have 3 other movies which have the same problem (whole movies). But hey, it works now. Thnx mate.

man I love this forum. :D

Nemesis7
22nd September 2002, 01:26
It works... damn it, when i mux with oggmux, the outcome is choppy. :(
Is there a way to do it with gordian knot? I know where to add values in the *.log file , but it doesnt use it.
And I think its jerky coz AVIUtil removed the original keyframes.

Ideas...?

Nemesis7
22nd September 2002, 02:52
Got it!
Do a first pass and then edit the LOG file and then do a second pass.
It should be 1 for keyframes, but the one before and after must be 0 or 1, else it still wont work.

Frame 0: intra 0, quant 4,....
Frame 1: intra 1, quant 4,....
Frame 2: intra 0, quant 4,....

Thnx anyway. :D