-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feature Request: (RIFE) Please add support for rational frame rate changes (like vs-rife has) #59
Comments
#59 Co-authored-by: akarin <[email protected]>
…RIFE #59 Co-authored-by: akarin <[email protected]>
Unfortunately, the feature in 2f6d598 is not as safe as |
How to reproduce it in vsedit/vs-preview? |
I cannot. I remembered holywu once pushed some commits too in his original repo to fix the similar issue. But the related issues are gone by deleting his repo. |
It is included i think. |
Why do you think |
No, i never talked about fps_num... |
Then
I can't reproduce that with vsedit or vs-preview. |
I knew, that's why I said |
Then we can do nothing. And we are using different implementation here compared to the original approach. |
Could you provide more information? For example, does the freezing occur at the same frame? Is it related to scene change, and what if you disable scene change detection? |
It froze when opening any video file or when seeking(when it ran successfully). I disabled scene change detection, still froze. |
Are you using SVP with "Duplicate frames removal" enabled? By "opening any video file", do you mean it does not return any frame at all? |
Does the frozen time depends on the number of frames of the video? |
seems so, video > 20 minutes took forever to load. |
That's a new information. What if you change your script to the following:
Does the playback still froze? |
cut2 = RIFE(cut1, multi=Fraction(5,2), model=46, backend=BackendV2.TRT(force_fp16=True, num_streams=2, output_format=1, static_shape=True)).std.BlankClip(color=[0.5] * 3) video still froze |
Do you know Python? I want to know which line of code in the This can be checked by inserting a line |
I inserted return clip into: so these lines cause issues?
|
This is alarming because it should not froze. In the original program, what if you repeat line 1142-1162 Lines 1142 to 1162 in 2f6d598
|
That's a very useful information. What if you simply call Alternatively, insert the following piece of code with open("num_frames.txt", "w") as f:
f.write(str(clip.num_frames)) This will create a file. What's the value in it? |
Thanks, now I fully understand what happens. Video playback is different from encoding in that the player will create a clip with a large number of frame, while for encoding the value is at most hundreds of thousands. This make the initialization much more demanding for vudeo playback. I will start to fix the issue now. |
Tried |
This line is necessary to prevent integer overflow when |
No, I mean the version I tested had the problem. Not this line caused the problem. |
What about |
|
What if you change this line to |
Emmm, doesn't help. For example, the original So I finally used a workaround below.
|
What difference does setting video_payer=True make? |
Allows the fractional RIFE to be usable in video players. |
So won't make any difference with mpv using svp? I've tried it by the way but didn't see anything. I assume SVP is not using fractional rife. Sorry one more question, how does fractional rife help? |
SVP has its method to handle Fraction and it works very well. I don't know if this will conflict with SVP though.
like if you want 24fps video to 60fps, then use a fraction(5, 2).
this works well for me. btw do you know any way to improve MPV seek time when using RIFE? MPV reload vapoursynth on every seeking, makes it slow compared with MPC-HC which instantly on seeking. |
IMO, This requires an expert to rewrite the implement of vs in mpv. Any heavy filters suffer the similar pain. |
No difference and conflict with existing svp. Yes svp should be rewritten. |
Tbh I don't have major mpv seek issues any more. V1 with the akarin update is as good as V2 which has always been good. |
Where do I place this code? I assume I have to replace some existing code? |
Are you sure you can seek as fast as playing without svp? Or you do not think it's a 'major' problem here?
I assume you were using svp, you have to wait for its support. |
SVP with Rife v4.13(v2) At 1080p x 2 (3D) downscaled to 1080p with hwdec=no : 1080p or 4K is about a second or less between each seek. V_20231208_153338_ES3.mov |
Apparently the limitation is hardcoded in vsmlrt. Line 1066 in 9f527a9
@netExtra You didn't get the point here. It can only prove your hardware is strong enough to handle it. But it can not cover the design flaw. And it's off-topic I think. Nothing here can do to fix it. |
I don't know if I have this right? But it works with no errors. Maybe even a little better than before because I was able to manually configure SC to fix the spider-man issue and get smooth enough slow pans. But it still causes stutters elsewhere so I'm setting it to 0.20 which if I understand correctly either disables SC or reduces its effect.
I thought you might say it was hardware related :) |
I tried the clip.std.AssumeFPS changes but I couldn't see any obvious differences for fast movement. |
It's mpv's workaround to fix duration. Svp probably did sth else. And it did nothing with fast movement. |
Note that all these AssumeFps's will break videos with variable frame rate.
... where
|
Unfortunately multi is an int.
vs-rife replaced multi with factor_num, factor_den with version 3.0.0 to support rational frame rate changes.
see: https://github.com/HolyWu/vs-rife/releases
The text was updated successfully, but these errors were encountered: