Log in

View Full Version : Large keyframe intervals and loss of visual quality


LeXXuz
16th March 2008, 04:49
I have some difficulties in understanding why so many people use such large keyframe intervalls like 300 as default setting in MeGui.

From what I see in my tests these intervalls reduce the visual quality of the video by far.

In slow motion scenes, especially backgrounds, I notice some kind of "detail jump" when hitting the next intra-frame. For example a background structure with low detail. The surface "starts to swim" and lose detail the longer the P/B-frame interval. Taking an kf-interval of 300 means that the background slightly loses quality over 6 seconds and suddenly (when hitting the next intra-frame) all the detail is back.

Even when using low quantizers and b-frame ratio of only 1.5 without any offset, I can slightly see this effect.

I have to admit I'm quite a visual quality enthusiast. While I see these effects, most of my friends/family dont see these and perceive the video quality as very good.

Right now I'm using kf-intervals of 25. The effect is much less but still slightly visible. Higher intervalls, like the default 300, are imho totally out of the question.

So I'd like to now what intervals do you use for your encodes and whats your opinion on this?

Dark Shikari
16th March 2008, 04:51
Higher keyframe interval will almost always give lower quality because its more wasteful.

Ideally, one would want infinite distance between keyframes, but that stops seeking, so its stupid.

If there's a "quality jump" at I-frames and quality degrades between I-frames, that's the fault of a crappy encoder.

LeXXuz
16th March 2008, 04:56
If there's a "quality jump" at I-frames and quality degrades between I-frames, that's the fault of a crappy encoder.

So normally the visual quality shouldn't degrade along a GOP?

Well I use Celtic Druids build of encraw to encode my videos.

Dark Shikari
16th March 2008, 05:09
So normally the visual quality shouldn't degrade along a GOP?Technically it should, but not by a large enough amount to be noticeable... Xvid does have a nasty tendency to have a "swimming" effect though, so I wouldn't doubt your claim.

LeXXuz
16th March 2008, 05:15
Xvid does have a nasty tendency to have a "swimming" effect though, so I wouldn't doubt your claim.

Oh nice... I just dumped DivX because of disturbing color banding effects on my hardware players. Now this "feature"...

Pitty that my players are not capable of X264^^

Any hints to reduce these swimming effects to a minimum?

Dark Shikari
16th March 2008, 05:18
Try using the MPEG quantization matrix instead of H.263, or try using a custom one.

LeXXuz
16th March 2008, 05:22
Try using the MPEG quantization matrix instead of H.263, or try using a custom one.

Thanks for your help Dark Shikari. :)

I will do some testing with custom matrices.

Ranguvar
18th March 2008, 22:13
Restating what D_S said... the encoder choses when to insert a keyframe, deciding when it's most beneficial tot he frames that will reference it (scene change). This just forces a keyframe if a certain time goes by without one, so as to let videos be seekable even during long single scenes, because the decoder has to look farther back to find the frame(s) the current frame is referencing.

LeXXuz
19th March 2008, 22:10
Restating what D_S said... the encoder choses when to insert a keyframe, deciding when it's most beneficial tot he frames that will reference it (scene change). This just forces a keyframe if a certain time goes by without one, so as to let videos be seekable even during long single scenes, because the decoder has to look farther back to find the frame(s) the current frame is referencing.

Thanks for your reply. Yes I'm aware of the scene detection within the codecs nowadays. I remember the time where this was not common, way before Xvid and Divx Network times...
DVB captures of poor hardware encoders show very "impressively" what happens, when a total scene change is not compensated with the set of an i-frame^^...



The effect I've described is only visible in slow-mo scenes or steady backgrounds. The video starts to "swim" more and more the longer the GOP size is. Resulting - to me - in a noticeable loss of visual quality. Thats why I reduced the max. intervall to 50 or even 25. The effect is still slightly visible, but with the default interval of 300 I find it really distracting. I wish I could find out what causes this degradation, I really do! Right now I'm totally fixated to this issue and "see it everywhere" if you know what I mean. :(

I'm really close to dump all my Xvid transcodes and stay with the mpeg2 sources. In times you get 1 TB of hdd space for under 200 bucks, disk capacity becomes more and more unimportant.

Unfortunately my player isn't capable of AVC, otherwise I would give that a shot...

olnima
19th March 2008, 22:35
...I wish I could find out what causes this degradation, I really do! Right now I'm totally fixated to this issue and "see it everywhere" if you know what I mean...


...one possibly reason for that is noise...

Olnima

Mr VacBob
20th March 2008, 18:54
What decoder are you using? It might be caused by DCT mismatch.

LeXXuz
20th March 2008, 18:59
What decoder are you using? It might be caused by DCT mismatch.

DGindex without mpeg2 deblocking => Avisynth 2.5 (no filters, no resizing, just mod-16 cropping) => xvid_encraw

Dark Shikari
20th March 2008, 19:00
What decoder are you using? It might be caused by DCT mismatch.This is true... see this page (http://guru.multimedia.cx/the-mpeg124-and-h26123-idct/).