Log in

View Full Version : Seeking Lag - Causes And How To Avoid/Prevent It


goldensun87
23rd April 2020, 21:27
So, this is something that confuses me. Shadowplay recordings that I make have a bitrate of 50 Mbps, but still seek fast and smoothly. But, for some reason I cannot figure out, H.264 videos I encode with MEGUI and mux into an MP4 container, have an annoying lag when I use forward or backward seeking. I know that MKV container has little to no lag, but is there any encoding and/or player settings I should tweak, to get rid of the seeking lag with MP4 container?

My CPU is AMD Ryzen 5 3600, my GPU is NVIDIA Geforce GTX 970, and I have 16GB RAM.

Atak_Snajpera
24th April 2020, 06:07
Reduce --keyint value maybe?

goldensun87
24th April 2020, 20:30
Reduce --keyint value maybe?

Where do I find that? MPC-HC or MEGUI?

videoh
24th April 2020, 20:35
MEGUI:

x264 config/Show Advanced Settings/Frame-Type/GOP Size

Make a smaller GOP.

goldensun87
24th April 2020, 22:45
MEGUI:

x264 config/Show Advanced Settings/Frame-Type/GOP Size

Make a smaller GOP.

Default minimum is 25, and default maximum is 250. What would be optimum lower settings?

videoh
24th April 2020, 23:28
I would go for minimum and maximum 25 and closed GOPs. Sure, it will be a bigger file but with multiterabyte drives these days...

I'm sure others will chime in to tell me I'm wrong. ;)

Anyway, it's just a hypothesis right now that the problem is GOP size. Try the above and see if it affects things. If not, we can look at other possibilities.

goldensun87
24th April 2020, 23:58
I would go for minimum and maximum 25 and closed GOPs. Sure, it will be a bigger file but with multiterabyte drives these days...

I'm sure others will chime in to tell me I'm wrong. ;)

Anyway, it's just a hypothesis right now that the problem is GOP size. Try the above and see if it affects things. If not, we can look at other possibilities.

Yes, reducing the GOP values improved the seeking performance. First time I tried 13 and 130, but there was still a little lag, so now I am trying 6 and 60.

Thank you for the suggestion :) .

videoh
25th April 2020, 00:06
You're welcome but it may not be the only issue. And Atak_Snajpera suggested it first.

goldensun87
25th April 2020, 00:22
You're welcome but it may not be the only issue. And Atak_Snajpera suggested it first.

He did, but I needed to know how to change the settings in the UI. That command will be useful if I have to use ffmpeg for anything though.

Edit: I have settled on the values 3 and 30.

hubblec4
25th April 2020, 14:26
For 20 years as I encoded video's, I used 2-5. The reason was not for seeking, but it is a good side effect.
And the files were not much bigger than anybody could think.

Atak_Snajpera
25th April 2020, 15:24
Keep in mind that very low value may introduce that annoying frame pulsing effect (key-frame injection) in static scenes. Besides 2-5 range looks ridiculously low! You are basically injecting key-frame every 5 frames. Even blu-ray movies use larger value (24=1s)

goldensun87
26th April 2020, 23:30
Videos which I had encoded without setting the keyint, they have a minimum of 60 GOP and maximum of 600 GOP. Makes me want to replay and re-record some of my video game playthroughs. Also, since I do not use keyframe seeking, the smaller GOP does not affect me at all, right?

videoh
27th April 2020, 02:17
All seeks have to begin decoding at a key frame, so not sure what you're saying there in your last sentence.

goldensun87
3rd May 2020, 01:49
I was talking about MPC-HC's different seeking speeds. It has small, medium, and large jumps, all of which can be adjusted, and it has keyframe jumps. MPC-HC's default settings has a keybind for the keyframe seeks (Shift+Arrow I think). I disable those two keybinds, and only use the small, medium, and large jumps. So, does changing the GOP values also change the length of the keyframe seeks?