New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Smooth motion like madvr? #731
Comments
Maybe one day... |
Similar feature request: #566 |
This is related to the other wish-list item #552. In a perfect world, you would just get the display to output the correct refresh rate and only if that fails, resort to frame blending. |
@Soukyuu I implemented it in the smooth-motion branch. If you want you can test it and check whether the result is satisfactory (I'd love to hear your feedback especially if you used the same feature in MadVR). The algorithm should be equivalent to the MadVR one. |
Great news! Might be a stupid question, but is smooth motion on all the time or is there a way to toggle it on and off to be able to compare it without having to install the non-sm build? There doesn't seem to be any log message about it in the console. On my only linux PC (which is a weak AMD e-350 one), I'm seemingly getting the same stuttery camera pans so far, with no blur added. If someone would be so kind to provide a windows build, I'd be able to test more reliably, I guess. |
@Soukyuu there's the :smoothmotion sub-switch. i.e.: --vo=opengl-hq:smoothmotion |
@pigoz it's working, but I have a weird side effect: the image is shaking left-right for about two pixels all the time, even on still scenes, which makes it look even worse than without smooth motion. I actually remembered I had another PC with linux (C2D+NV8600), so I tested there as well and same thing happens. This is on arch x64 with the radeon/nvidia drivers installed, respectively. Happens on all mkvs tested, for example Vivid-Asenshi's Akame ga Kill 23 |
(I can confirm the stuttering using |
it doesn't seem to happen here :/ |
I pushed a commit that may or may not fix it. |
Still happening here. Tried with both 8-bit and 10-bit h264. |
Like @pigoz I don't have the problem on this mac (10.10) tried with : |
I just saw #1338 and it seems that the "garbage pixels on the right" mentioned there are actually the first few pixels from the left side of the screen. Could that fix have something to do with the shaking? This time tried with:
|
There should be no garbage pixels, is the correct commit checked out? |
I meant that your fix fixing that issue might have something to do with mine and @Argon- issue. No garbage pixels visible with the commit currently checked out. |
At the time I noticed it (yesterday, after your linear light commit) I didn't do any testing (not even |
Doesn't happen when using commit adc236c, but I'm not sure if |
Same here, that commit works (but has garbage pixels at the bottom). So looks like I was right about the fix for the garbage fixing breaking it for me. I can also see it's working, but compared to madvr it looks like it introduces more blur and still leaves some stutter where madvr does not. Take akame ep 23, the third scene after the OP (horizontal pan in front of the gate:
It kind of looks like madvr either interpolates more often, or has a different criteria to interpolate. |
Hm maybe mpv is missing the vsync in your case? |
I am not sure about that, because the latest commit didn't seem to have the issue. Maybe it was being masked by the shaking of the image? I looked at nvidia-settings and "sync to VBlank" is enabled. The display is a regular 60Hz TFT |
I have just tried the latest commit, and the L/R stutter is gone. I assume this is also the reason why with smooth motion enabled it appears more jerky than without it. Running with --vo=opengl:smoothmotion appears less jerky, but about the same number of frames is reported as dropped. Both GPUs were able to handle madvr's SM. |
keep in mind that the framedrop count is busted (it reports as drops stuff that is not a real drop) edit: I just changed how the frame dropping code reports frame drops to avoid the wrong numbers. |
Oh, didn't know that. With the new revision, no frames are reported as dropped, but the jerkiness with SM enabled still appears to be higher for me as described above. |
I managed to compile a cygwin build on my windows 8.1 x64 machine and it runs a lot better on a 260GTX. It's definitely an improvement over SM disabled and it also seems to be less blurry than madvr, unless I'm seeing things. There are a few jerks now and then though, which only happen randomly: replaying the scene, parts that didn't stutter might stutter and vice versa. If you need me to provide any information, just ask. |
Maybe on your particular configuration mpv is missing some vsyncs (as opposed to madvr we don't prerender frames). If this started being an issue in the latest commits, I can make the code a little smarter and draw as soon as possible (to avoid being late for the vsync), and then sleep until the vsync. |
I'm not sure if it started happening on latest commits, because I always attributed the jerking to the lack of smooth motion. It's happening on all 3 machines though and on different OSes, plus they're all fairly low end by today's standards, so maybe that's it. Why is mpv not pre-rendering frames though? That could improve performance for lower end hardware. |
In the last commits I changed slightly the timing at which each frame is prerendered (before it was at early as possible, now it's at most 4ms before vsync but that could cause problems with bad hardware), so that's why I asked specifically. From my understanding, MadVR also prerenders several frames in advance, but that would be very hard to do in a simple way within mpv. |
I'm not confident that this would be possible in OpenGL without running into severe problems and overcomplications. |
I'm not sure if I'm not just getting hit by a performance penalty because of compiling and running mpv via cygwin. Are there native build instructions for windows? How are the binaries by @lachs0r compiled? About buffering, good to know. My openGL knowledge is pretty basic, hence the question. |
@Soukyuu There are three ways to get a native build:
mingw-w64-cmake is what lachs0r uses for the windows builds. I however find mxe easier as it has fewer intermittent failures due to constantly changing dependencies. I haven't tried msys, although it sounds pretty straightforward. |
|
The instructions for mxe and msys2 are now on the same page: https://github.com/mpv-player/mpv/blob/master/DOCS/compile-windows.md |
I'm giving up. mxe builds binutils fine, but fails to build bzip2 because
That's on two separate PCs. The pre-made mingw64-cmake env vmdk image fails at download/verify/extract openssl step |
That's what I meant by pre-made mingw64 image edit: it could probably be faster if you just make a test smooth motion build if it works for you... |
Yesterday it worked. Seems like openssl.org fucked up and deleted the source archive. |
Let’s just wait until openssl.org stops being terrible at everything they do and gets the archive back up. |
I guess. |
They’ve just now released a new version. It built successfully here so I’ve pushed the update to mingw-w64-cmake. |
Well, I don't know.
|
Does it work if you rm -rf packages/enca-prefix and retry? |
Yes. I'm stuck at ffmpeg step now with the same problem, and removing ffmpeg-prefix doesn't solve it. I was able to get msys working though (was starting msys2.bat, not mingw64-shell.bat) and it turns out the performance is on par with the cygwin build. It also shows exactly the same behavior, so I think it's something about the code. Another interesting thing is that enabling smooth motion pushes my CPU usage to 60% per core (AMD Phenom II X4 970@3,4GHz), while GPU usage does not increase, or rather, is really low.
That's a really huge impact on CPU... |
That seems pretty wrong. Maybe some active waiting or so. |
(The ffmpeg problem is fixed now, git pull and remove ffmpeg-prefix.) |
Well, fwiw, the impact on my linux machine (core2duo T7250@2GHz) is not that big, only about 10% (I managed to finish compiling mpv in VM, but it crashes on start with a generic "stopped working" message even without any options specified) |
That would indicate the mpv repo isn’t updating properly. Sigh. |
Well, from what I saw I had to modify packages/mpv.cmake and add a
to it under the GIT_REPOSITORY. Maybe that broke it? |
Okay. The fix that went into master earlier isn’t in the smooth-motion branch |
Now this is in master with some changes. If the result doesn't look ok on your system, please open another ticket. |
I have recently tried mpv again, just to compare it against mpc-hc with madvr output. The first thing that I noticed is that all the 23.976fps videos appeared less smooth on pans on my 60Hz monitor.
madVR has a feature called "smooth motion", where it converts the framerate on-the-fly, allowing to keep the smoothness of video playback. It would be really nice to have something like that in mpv in the future.
The text was updated successfully, but these errors were encountered: