mpv
                                
                                 mpv copied to clipboard
                                
                                    mpv copied to clipboard
                            
                            
                            
                        lots of mistimed/delayed frames with --video-sync=display-resample
My mpv version is the latest one from https://mpv.io/
When I enable the --video-sync=display-resample option, it looks worse than the original (the original wasn't good enough for me so I'm trying some different things). When I open up the info panel with SHIFT + i, it shows me a lot of vsync jitter, vsync ratio, and a lot of mistimed/delayed frames. I am running a 29.981fps clip on my 144hz 1080p monitor.
Also, for some reason, when I don't make it go fullscreen (double click), or resize the window, it seems to make the playback much smoother? Looking at the timings, there's a lot less mistimed/delayed frames, but it still isn't perfect.
I'm running on windows 7 64x btw.
Reproduction steps
Basically enable the --video-sync=display-resample.
Expected behavior
smooth playback
Actual behavior
stuttering playback
Log file
https://pastebin.com/LDLbzv51
@deama try adding "vo=gpu" "gpu-context=d3d11" to your config file and see if it's better.Looking at your log it falls to software decoding (your GPU is not used,only the CPU is) and in this situation you'll get higher jitter and bigger frame lost when using "video-sync=display-resample".You need to force the GPU to do the decoding if of course the codec is supported.On my system(laptop) the jitter is 0.008(that's normal) and the FPS sync is about -10(frames)(display fps: 59.996 after sync: 59.868) i consider this normal(old laptop).Would suggest you not to use "video-sync=display-resample" if codec is not supported,this way you'll get a better results.
Hmm, that didn't do anything, I'm supposed to add them like this? --gpu-context=d3d11 --vo=gpu
The jittering for me it says 0.429 ish, and the ratio is 4.430 ish. I'm guessing those are pretty high? The clip I'm trying to play is an mp4 with the HEVC codec(H.265), is this codec not supported? I tried a different video with h.264, same problem; I then tried another clip I have but this one had the mpeg4 codec, still same issue.
@deama why don't you try shinchiro's build: https://sourceforge.net/projects/mpv-player-windows/files/64bit/ . Not sure about h265 but h264 is supported for sure when you using d3d11.
P.S. Also update your GPU driver to the latest,from the NVIDIA page not from Windows
If you add them into a config file, then like this:
vo=gpu
gpu-context=d3d11
You could also try to add this as well: gpu-api=d3d11
Edit:
api... but if I understand the manual here correctly, it should actually not make any difference.
I tried shinchiro's build, but this time it says "No hardware decoding requested" even though I put in: profile=gpu-hq log-file=mpv2.log video-sync=display-resample gpu-context=d3d11 vo=gpu
in the configuration file. I also tried "gpu-backend=d3d11", but that didn't do anything.
@Hrxn "gpu-backend=" ????????? Where did you get that argument from.There is nothing like this mentioned in the reference manual ?
@deama update your GPU driver !!!!!!!
@dnmTX Yeah sorry, I "remembered" something from somewhere else... Fixed the comment.
I currently have the "398.11" nvidia drivers, which is the latest stable release.
I'd wait for dev to pitch in.....i'm out of ideas anyway.🤔
Hmm, maybe related to Windows 7..
Do you have this Windows 7 Platform Update thing?
Go to the Control Panel, Uninstall a Program, select View Installed Updates from the left, and scroll down till you find KB2670838
Yes I have the KB2670838 update.
The jittering for me it says 0.429 ish, and the ratio is 4.430 ish. I'm guessing those are pretty high?
yes the jitter is high. the ratio is expected to be high in your setup, eg it just describes the ratio between display fps and video fps (144Hz/29.981fps ~ 4.8). so the quantity of that value isn't important but it's stability. if it's jittering around a lot that's bad, that's what the jitter value says.
for testing run your display with a lower frequency. mpv might not be able to keep up with the 144hz for whatever reason. other reason could be the not optimised hevc decoder, so try with something encoded in h246.
Looking at your log it falls to software decoding (your GPU is not used,only the CPU is) and in this situation you'll get higher jitter and bigger frame lost when using "video-sync=display-resample".You need to force the GPU to do the decoding if of course the codec is supported. ... Would suggest you not to use "video-sync=display-resample" if codec is not supported,this way you'll get a better results.
that is completely untrue. it doesn't fall to software decoding, it doesn't try any hwdec in the first place because it's deactivated. he would need to use --hwdec=auto or similar. no, software decoding doesn't cause higher jitter or more dropped frames (though it can in certain circumstances). it can even be faster and mostly is more stable than hwdec.
@Akemi it does fall to software decoding when the codec is not supported(i have hwdec set to d3d11va and playing .avi files always falls to software for example) and it does cause higher jitter and bunch of lost frames with ....=display-resample,same as OP and no,it's not faster neither better.So please,speak for yourself instead of in general.
avi is a container not a codec and has nothing to do with hardware decoding. sure it does fall back to software decoding when the codec is not supported, but OP's log doesn't indicate that it does try at all because hardware decoding isn't activated in the first place so it doesn't fall back. the one who generalises things is you.
no hardware decoding is in general worse than software decoding because it has several limitations. it's only useful for very slow systems, at the moment in the case of hevc when the unoptimised software decoder can't keep up or if you desperately want to save some battery. the latter isn't even always the case. i am speaking for the general opinion of the developers. if you have such problems with software decoding something is wrong with your setup.
Well, if I lower the Hz of my monitor the jittering decreases a lot (setting it to 30Hz while playing a video at 29.981 reduces jittering to 0.002), but do I really have to change my Hz everytime I want to watch something? I doesn't look any smoother either, it looks kinda worse. I tested this on a h.264 codec video.
EDIT: also, how do I get "--video-sync=display-*" to work? If I enable it, it doesn't seem to do anything, nor does it use more CPU power.
30Hz is a bit low, i was more suggesting like 60Hz for a start. on a side note and i am just assuming here since i don't know what content your file is, ~29.9fps can indicate that it's a badly IVTC/decimated (or not at all) file that already has stuttering in it to begin with, eg duplicate frames. most content is ~24fps (especially BD/HD content), with the usual exceptions like TV or some DVD content. anyway you should make sure the actual video file is already 'smooth', display-resample won't help with bad files. if the file is fine you also need to activate --interpolation to make it look smoother.
i will be more specific so we can get to the root of the problem. test with 144hz and a h264 file and see if the problem still persists. if it still persists, like with the hevc file, there is a problem with presenting at 144hz. if the problem is gone, it's most likely a problem with the hevc file and decoding speed.
for the former problem of presenting, lower the refresh rate to 60Hz and increase it step by step to 144hz. test every step and see when the problem occurs.
for the latter problem the decoding, you might be out of luck. there were some ffmpeg hevc patches (especially the first one) around that improved decoding speed, though i am not sure if they are still necessary. another way of testing is getting hwdec to work, if your system supports it, and see if it helps.
Alright so I've done some testing and such. After enabling --interpolation, it seems to have fixed the large amount of mistimed/delayed frames which ended up making it nice and smooth. I still get jittering at 0.25ish (this is at 144hz). I then switched to 60hz which reduced the jittering to 0.08ish, but I think it slightly made it worse? I'm not sure though, because I can see more tearing lines, and they're more obvious.
The clip I used was a h264 with an fps of 23.976. I can't find any clips that are either 24 or 30 on my comp, do you have any links to some test clips or something like that?
23.976 is ~24fps, so that's fine as far as it concerns me. the ~29.9fps clip i was referring to was the one you used in your initial issue, the hevc one.
0.25 seems still a bit high but if you don't see anything visually wrong, i don't see a problem.
tearing lines shouldn't occur at all and are a separate problem entirely. since this is probably a platform specific problem i can't help you with that. but it's probably related to vsync(?)
Does mpv have an option to force vsync?
yeah, in your case i believe it's --d3d11-sync-interval, but vsync is always on by default. maybe your gpu driver do something unintentional. people on irc that actually use mpv on windows can probably help your better with this.
It's probably something to do with me disabling aero (cause I don't like it).
You may be getting some tearing.
Try using this
hwdec=auto video-sync=display-resample interpolation=yes tscale=oversample
or one of the other tscale values
FWIW on my end it was a Pipewire issue, and changing ao= fixed it.
I notice that OP is a Windows user, but switching the ao= setting might still help.