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 interpolation without display-resample #7674
Comments
i doubt anyone knows what exactly you are requesting here. you have to be far more specific in what you actually want. |
It would help if you tell me what you don't understand, because to me it is very clear. :/ |
I don't understand. How is
Frame blending is how oversample works in mpv. |
why are you guessing instead of properly explaining what you want?
linking a google search is not an explanation. obviously you should explain what Smooth Motion is, because that's what you want?
i am well aware what display-resample does.
what problems? if you want interpolation without display-resample does that mean you want to interpolate to arbitrary destination fps? instead of arbitrary, should it interpolate to the smallest divisible integer fps, eg 24fps src, ~60hz monitor, interpolate from 24fps->~30fps since 60/30=2 (would be same case for 120hz). so it would safe some CPU cycles? |
I just check my CPU and GPU stats and can see more ressources are used. It is also confirmed by developers ("- thus increasing power usage by a factor of 2x-3x in such a case")
No. There are several ways to achieve accurate frame timings, for exemple, good refresh rates.
Looks like the title, except I don't need t_scale settings, just a basic frames blender when needed.
display-resample doesn't aim to reduce 3:2 pulldown. And if your refresh rate is good, display-resample is not needed (except if you want to use interpolation, but it is not recommended if you don't want blur/flickering).
But it works only with display-resample, which uses more ressources and causes more flickering.
Well. I don't know how to put it nicely without create a drama... If you don't understand and don't ask precise question, maybe you can ignore this thread and we'll be fine. OK ?
Well, that's not the aim of this ticket, but here is an example: #6271
There's no "arbitrary destination fps" since this algorithm doesn't change fps. It just modifies some frames (by blending 2). |
Of course it uses more resources, it renders a frame on every vsync for timing reasons. The 2x-3x is an absolute worse case scenario (same frame being repeated over and over again). But yes, better video playback taxes your computer a bit more. That's how it works.
I do not know about madVRs internals, but simply setting a custom display mode does not guarantee that the audio clock and video clock will never drift from each other. It is true that setting a "good" refresh rate (like an integer multiple of your video fps) will probably have less issues than the standard 60hz display, but it is not a solution to audio/video clocks drifting from each other. Also this isn't the job of mpv to set your display modes, we're crossplatform. Use whatever your OS provides for this (I do this on my own machine).
Sure but asking to do temporal interpolation without knowing when frames actually occur doesn't make sense. You're asking for the A A A+B B C C C+D.... etc. pattern (aka oversample in tscale). How do you want us to blend frames correctly together if we aren't rendering on every vsync (which is what
I wasn't suggesting this, but see the above for the explanation on why it's needed.
I don't understand what you mean by this.
If you are on the correct refresh rate (i.e. an integer multiple of the video), then you don't need interpolation. |
it's not my responsibility to ask overly precise questions if you can't put your wanted behaviour into precise words. you do realise i am asking because we (developers) don't know what you want from us? if you want me to ignore this feature request that's fine by me, though it will either get closed or ignored that way.
maybe you should read the comment you just linked yourself:
i dunno maybe you are misunderstanding |
Well, that's not how madVR Smooth Motion works. Negligeable ressources. display-resample is using not negligeable ressources.
Did I say it is an interpolation method ? No. I know what display-resample does. The alternative interpolation method I mentionned is "madVR Smooth Motion" which does NOT need to resample audio or change video speed or other things display-resample do.
Well, that's the reason of my ticket in fact. To motivate a developer who knows what it needs to make the correct algorithm, like madVR did (or Zachs with his Fluid Motion in MPDN).
madVR smooth Motion doesn't flicker as much as display-resample + t_scale = oversample. And that's because of display-resample.
Well, I explained myself clearly, I can't explain Smooth Motion better than madshi did. Smooth Motion is quite known now, and you'll find references to this in other tickets, and it's a requested feature also in other applications like VLC for example.
Well, if you don't understand me, and if you don't understand explanation from original developers, I don't know what to say. But if you don't understand, that's not a crime, I just hope one developer (who understands what I'm talking about) is interested in implement this in mpv. |
we prefer to not deal with this like this then. |
If you need something primitive that "upconverts" to a fixed rate, you can just use one of those ffmpeg filters. |
"We"... Yeah. w/e @wm4: I'm not sure to understand, since Smooth Motion is not primitive to me, but if you know a command/syntax with ffmpeg which allows to mimic madVR Smooth Motion, I'm interested (just remember I'm a basic user and no developer). |
madshi said that smooth motion also increases resources in the thread you linked.
Oversample is "smooth motion". It's not a different interpolation method. Also,
What do you mean by "flickering"? When someone says their display flickers, that normally means it blinks off and on rapidly. |
Here is a comparison. Scaling settings are not important, we just want to compare Smooth Motion (enabled/disabled): The difference is really visible (higher GPU Clock and D3D usage, higher CPU).
It does. Yes it resamples audio but it also changes video speed: "this mode will also minimize unnecessary frame drops by slightly changing the video playback speed "
Yes, it costs a bit, but it's negligible, as you can see on my screenshot. On an Intel GPU, it is noticeable, but not that much.
Smooth Motion implies flickering, and it is noticeable in end credits for example. If you compare madVR Smooth Motion and tscale=oversample, you'll see there's more flickering in mpv. If you want less flickering, you have to change tscale, but then all tscales will have blur (a lot depending on the setting). |
Of course it matters. If you don't start at the same baseline, then comparing the increases between the two is meaningless. You can probably spit out bilinear super fast but other settings may not be as simple.
I can use
This is my mistake. I forgot that it did a slight adjustment on refresh rates.
A 7% increase isn't negligible.
I still have no idea what you mean by flickering. Do mean to say that the motion has more judder? You can change the tscale parameters to your liking. |
Scaling algorithms, debanding, dithering etc. are nearly the same, they don't have impact for this comparison. Don't you find strange that without SM, mpv uses less ressources than madVR, then using SM, mpv uses more ressources than madVR ?
There's not 7% increase. I guess you took the last values on graph, but if you compare CPU curves in time, you can see they are identical (my CPU, an i3, is too powerful to show difference). For GPU, it's the same clock frequencies, and again, D3D usage is identical (powerful card).
Well, on end credits (black screen, white text), it's easily perceived, it seems images are blinking, like if there was a black screen, white text, black screen, white text, etc. That's a side effect of judder indeed, but the blinking/flickering is amplified with smooth motion (I can't find a link, but I though I read it from haasn for example, but maybe it was madshi).
Except oversampling, others ("Convolution-based") cause way too much blur to be usable. |
Nearly the same? They need to be exactly the same otherwise, again, this comparison is meaningless.
No, because mpv's defaults are not equal to madVR's defaults and I have no idea what settings you are using otherwise for either program. According to your screenshot, the CPU clock is always lower in mpv though. But again see above.
I have no idea how long this sample lasts and that's the hard number given.
I have never ever seen this.
It's not just the scale itself. Various other things like |
For what it's worth, madvr must be using something like It sounds like
|
If it's about random guessing what madvr might do: maybe it doesn't redraw on every display vsync, and does "repeating" of frames simply by waiting, or it switches the framerate, or makes the compositor take in the desired framerate. mpv's display-vdrop still redraws the frame for each display frame, it's just display-sync without audio resampling. (Redrawing on every display frame is, in my opinion, still the least messy way tp lock on reliable to the display refresh rate.) |
@Dudemanguy : Let's agree to disagree, I find my comparison very relevant, independent to scaling etc. @kevmitch: I guess you know the diff between "audio" and "display-vdrop", in my case I don't, since I trust the manual: "(Although it should have the same effects as audio, the implementation is very different."). But anyhow, you understand what I want. @wm4: You can find information by madshi through this link: https://forum.doom9.org/search.php?do=process&showposts=1&searchuser=madshi&query=smooth+motion&order=ascending&searchdate=2640 (you may need to change 2640 by a higher value in order to have posts from 20th February 2013 if you click this link in some months) |
I won't crawl through that awful forum just to try to guess things I either don't care about or already know. If you present me the information on a silver plate, then maybe I might care. (That's just how OSS works.) |
As I'm no developer, and madVR closed source (MPDN too), I can't give you much. My words/posts would be useless boring blabla for you. |
I have no idea what's going on in this thread (and I stopped reading somepoint midway) but I wanted to quickly point out a few things
Anyway I'd probably recommend closing this issue in favor for more specific issues addressing the individual points above, since such "please make things faster" meta-issues are likely to end up stalled. |
madVR does not touch audio, so indeed, no resampling.
Indeed, madVR has an integrated tool to create custom refresh rate, but it has nothing to do with Smooth Motion. And I don't want mpv to do that. To be honest, this integrated tool in madVR should be in a separate app, since it's particular, can be broken easily (because it relyes a lot on GPU broken drivers).
It appears I have a voltage monitor plug, so I can compare graphs and power consumption. I can assure you my graphs are really consistent. The spike in consumption is when GPU clock goes > 1000 MHz (which is not the case in my graphs). It's also true for CPU, but it is less marked. I kept these 3 graphs after carefully comparing real power consumption and these stats. These 3 are the ones which match consumption. D3D usage has less importance, it is just for comparison when GPU clock are equal between 2 tests (the higher the D3D Usage, the higher the chance to use a higher GPU Clock)
There's already an increase of GPU ressources without interpolation, just with display-resample.
I didn't ask to make things faster. I've waited several months before to create this ticket because I remembered of a ticket about implementing Smooth Motion and it had been closed because the solution was to use display-resample and oversample, and for me it's not the same as madVR Smooth Motion.
But with a 60Hz monitor, Smooth Motion is THE solution to handle judder like 3:2 pulldown. |
The fuck? |
Any DS mode requires blitting/repainting. It's simply a consequence of how we measure the display clock (by presenting to every vsync event). And actually, I even forgot that the Speaking of which, I just saw that even the (Side note, I also realized that drivers might have optimizations to make re-queueing the same frame for presentation twice in a row be the equivalent of just blocking for another vsync. (And if they don't, that would arguably be worth a bug report). So regarding my earlier note, simply queueing a frame multiple times might be the most realistic path towards achieving this zero-copy blit. Assuming the blit is a source of significant GPU load.)
This is wrong. The smoothmotion algorithm does repeat frames, exactly the way |
I don't know if I understand it well but the default display=audio has no cost on GPU.
In fact, some optimization would be to have a diffrent mode than display-resample.
I'll try to benchmark this in next Shinchiro build, but I don't expect major changes in terms of performance. But it could have a positive impact on flickering. It could explain why I perceived more flickering than madVR.
Report a bug to GPU brands ? Wow. I though nobody had success with this. But anyway, it needs to come from a true developers who knows what he's talking about, not me.
My bad, I explained it badly. Of course they will be repeated frames (A A A+B B C C C+D). But I meant in cases like 59,94 fps on 60 Hz, let's forget about the 2 repeated frames each time, there will be 1 time when a frame would be repeated 3 times, and that's when Smooth Motion prevents that in blending two frames (hence I said no repeated/dropped frames, it was just in case of mismatch). If you manage to have the "oversample" works without display-resample and if it uses minimal ressources, my request would have been totally fulfilled. And thanks for your time and the constructive dialog. |
That "flickering" you mention (and which we can't know what it's supposed to be) is probably just because your GPU can't keep up with the high refresh rate. |
Well anyway it sounds like this issue can remain closed. I'm not reading much else out of this besides questions which have either already been answered (use I'll leave it rest for now. |
Also, no idea why you'd want to disable audio resampling though. Maybe an audiophile argument? What audiophile dumbasses don't know is that anything audio related probably has a resampler hidden somewhere for synchronization purposes, whether it's in hardware, OS audio code, or when the audio/video was produced. |
@wm4: No. It's not this kind of issue. In fact, forget about it because I can't explain it clearly. I'll try again but I would not be surprised if you still don't understand (my bad again): @haasn: the default video-sync=audio does not resample too. And my request was not to improve interpolation, but not using display-resample. Thanks again for your time, it was nice to have your opinion. @wm4: Tbh, I don't care about resampling or sound quality, it's just that I don't need changing speed for audio or video in fact. Let audio plays like it has to, let video follows audio (that's why video-sync=audio is fine to me), and when there will be a need to repeat/drop a frame, just blend it in order to have a better motion sensation instead of a "jerk". |
@Nojevah What kind of display are you using exactly? 120 Hz? Any FreeSync, G-Sync, Whatever? |
No, it's a TN 120/144 Hz, I don't use Freesync, G-sync etc. But the flickering is not linked to monitor, it is visible on all 60 Hz LCD panels (my TV included). Maybe it's less marked on OLED panels... |
Yeah, that was my next question. But if you've already tried this with different displays, 60 Hz included... |
I use However, I find it weird that mpv still uses up a lot of power even if frame-rate of video matches refresh-rate of screen (e.g. playing 60fps video on 60Hz screen). Things remain similar after interpolation is disabled. Currently I use an auto-profile to bypass these situations:
|
I think I know how frame resampling could be creating flickering for Nojevah. Gamma/power curve differences for the pixels on blended frames. ie luma 240 as white and 16 as black, 128 for blended between a black frame and a white frame. On a properly calibrated monitor with a gama of 2.2 for SRGB, the two adjacent 128 luma lines will perceptually appear the same brightness as a single luma 240 adjacent to a 16. On uncalibrated displays or with a host OS gamma other than 2.2, there will be apparent brightness changes from frame to frame introduced due to output power*area differences. This effect is used for subjective gamma calibration of displays for this reason... and TN panels are notoriously difficult if not impossible to get accurate gamma for since gamma changes with viewing angle, esp. vertical viewing angle, resulting in TN panels having an effective gradient of gammas from top to bottom. Many cheaper TVs use TN and/or have poorer calibration. So @Nojevah I would recommend you check for flickering on (P)VA and IPS panels, and also try adjusting the gamma through your OS display preferences to minimise the flickering. Gamma (power curve) is frequently mis-labelled or simply not present in display preferences, sadly. I've seen it labelled as Contrast, Brightness, even Saturation. If your display is properly calibrated, gamma adjusts the brightness of mid-tones and leaves the extremes of bright and dark alone. If the display is mis-calibrated then gamma may alter the amount of black crush, highlight clipping, lower the darkness, or raise the brightness. That's how it gets mis-labelled... by developers and manufacturers who don't understand their own hardware. To check / adjust your calibration for LCD panels, see http://www.lagom.nl/lcd-test/gamma_calibration.php Ideally make the changes via the monitor's settings rather than the OS display driver settings. If you attach multiple displays you can't separately adjust them from the OS. You'll also get higher image quality doing it at the display. The OS/driver must work within the limitations of the display's gamut (3D volume of reproducible colours.) If the display is calibrated the gamut may be increased, leading to more possible colours and a higher degree of fidelity. |
Thanks for your investigation but I'm not interested in a solution based on display-resample for performance reason. |
Expected behavior of the wanted feature
You certainly have heard of madVR Smooth Motion. It also exists in another less-known app (MPDN).
It creates blended frames to improve motion. For the 3:2 pulldown, in 60 Hz, it does not change 48 frames but it creates 12 blended frames.
This solution is CPU and GPU friendly.
If you want to use display-resample and oversample interpolation in mpv (which is supposed to be the equivalent), first, it is CPU and GPU heavy (because of display-resample), plus it causes more flickering.
Display-resample also has some problems, and is totally overkill when having a correct (high) display refresh rate.
I hope this request won't be close, I just created this thread in order to motivate someone who might think Smooth Motion already exists whereas it's not the same (perfect) Smooth Motion as madVR.
The text was updated successfully, but these errors were encountered: