PDA

View Full Version : x264 keyframe pumping


turbojet
2nd June 2009, 06:49
Hi,

I'm having some trouble getting decent results encoding some hybrid clips, here's a sample of the source (http://www.mediafire.com/download.php?eatk3yioyyf). I've found out it's because the keyframes look so much different then the P/B frames.

What I need is:
- crf 26-30, they are BD extras
- max-keyint 24, need very quick seeking due to menu calling them in different spots
- vbv maxrate 25000 vbv-buffer 25000 or lower for DVD playback
- interlaced since they are hybrid clips

Things that I've tried that do help but they don't meet the requirements:
- crf <20
- max-keyint >120 or so
- xvid has no pumping at bitrates around what crf 26-30 give and max-keyint 24 although it doesn't look very good.

Does anyone have any suggestions on reducing the keyframe pumping?

Dark Shikari
2nd June 2009, 07:16
I can't replicate any sort of "pumping" effect on that clip: the P-frames and B-frames are nearly 100% skips, so I can't imagine how one could possibly claim them to be "different" from the I-frames.

Now, what you might be referring to is the fact that the I-frames look slightly different from the previous P-frame, due to intra prediction giving different results than inter prediction. There are only two ways to avoid this kind of popping (other than the obvious of using a very high bitrate or not putting I-frames on non-scenecuts):

1. Use periodic intra refresh and no I-frames. Not possible on a DVD.
2. Use an encoder that encodes each I-frame as a P-frame, and then encodes the I-frame relative to the P-frame instead. Can result in progressively degrading quailty throughout a long near-static scene.

I could hardly notice the effect visually while watching (I had to actively look for it), so I don't really think it's a big problem in this case.

turbojet
2nd June 2009, 07:23
I forgot to mention that sample is the source, if you encode with --crf 26+ --max-keyint 24 I think you will notice it.

I've done some other hybrid clips the same way and they've turned out fine but they didn't have telecine info on the borders.

Dark Shikari
2nd June 2009, 07:28
I forgot to mention that sample is the source, if you encode with --crf 26+ --max-keyint 24 I think you will notice it.Yes, I know, that's what I did.

"Pumping" in my mind refers to the case where keyframes are significantly better quality than the frames around them--something that is not the case here. This is just intra prediction differing between keyframes, something you'll notice even more if you set the keyframe interval to 1--which means P and B-frames have nothing to do with it.

turbojet
2nd June 2009, 09:05
Here's a sample (http://www.mediafire.com/download.php?y4zmzqjzroq) which may emphasize the issue a lot more.

A few other things I found out that help the issue a bit are:
- cropping the borders then readding them, this is a possibility for my situation
- not using --interlaced which isn't a possibility in my situation but in this sample no interlaced produced a smaller file with less of the issue. The full clip was considerably smaller with --interlaced with the same settings, does this make sense?

Also on this sample xvid does produce a little bit of the issue with interlaced enabled, without interlaced it doesn't have the issue. HCenc and CCE both don't show the issue. DivX 7 emphasizes the issue a bit. Do you know if this issue is some interlaced MPEG4 or even H.264 deficiency?