-
Notifications
You must be signed in to change notification settings - Fork 4
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
ChangeFPS/SelectEvery plummets the speed when outputting at a lower framerate #7
Comments
Thanks for the report. This is indeed an interesting issue. Confirmed the 100x slowdown between these two scripts: from vapoursynth import core
clip = core.lsmas.LWLibavSource(source=a, format="YUV420P8", cache=1)
clip = core.std.AverageFrames(clip, weights=([1]*5))
clip.set_output() slow: from vapoursynth import core
clip = core.lsmas.LWLibavSource(source=a, format="YUV420P8", cache=1)
clip = core.std.AverageFrames(clip, weights=([1]*5))
clip[::4].set_output() Profiling reveals that lsmas spent most of the time on the 2nd script. I think it's because vs api4 changed the way it caches frames from source filter. The combination of For example, if I change the hardcoded 20 to 100 in this line: vapoursynth-classic/src/core/vscore.cpp Line 1186 in 8fb4730
the slowdown is reduced to 4x, similar to R54. Will need to think about the root cause more. |
I've created a workaround for this issue. Please try this build download the release zip file and replace your vapoursynth.dll with the one in the zip. It's a safe change, but its performance implications are not well understood at this time, and more benchmarks are needed. Thanks. |
Thank you so much! It is indeed working (faster than R54!) if it ends up being unstable for other specific usecases, please make it optional (if that can be done after VS loads) for mine with something like |
Testing didn't show any noticeable performance regressions, so I will keep the workaround and released https://github.com/AmusementClub/vapoursynth-classic/releases/tag/R57.A6. Thanks for the testing. |
I am using AverageFrames with a video that has FPS in the hundreds, here's a 280FPS sample
When I use SelectEvery to lower the output framerate, rendering speed shits itself (500FPS -> 2), this doesn't happen on R54
You can try with the sample video and commenting/uncommenting the line in this script:
Using a BlankClip does not tank the speed, using a clip with only I-frames (e.g encoded in a lossless codec) makes it tank less (~20FPS from my single test)
The text was updated successfully, but these errors were encountered: