OpenFunscripter / OFS

A tool to create funscripts
GNU General Public License v3.0
90 stars 38 forks source link

Excessive cpu usage in mpv.dll #2

Closed NodudeWasTaken closed 2 years ago

NodudeWasTaken commented 3 years ago

Hello Gagax!

Im experiencing excessive cpu usage when using OFS from mpv.dll. When opening 8k 60fps footage i saw this performance in OFS 1.1.9 1 1 9 And this performance in OFS 1.3.0 1 3 0 Those were screenshots with the video not playing, with it playing the gpu usage shoots up 1 1 9_playing When attaching a cpu usage profiler i can see that its apparently mainly in mpv cpu-usage-report A quick log when opening the file

ERROR: Failed to load json: "C:\Users\my_user_name\AppData\Roaming\OFS\OFS_data\keybinds.json"
INFO: Opening video: "Y:\path\video_3840p.mp4"
WARN: Couldn't find funscript. "Y:\path\video_3840p.funscript"
ERROR: ! MPV (main): Option seek: invalid time: '-NaN'
 !
ERROR: ! MPV (main): Command seek: argument target can't be parsed: option parameter could not be parsed.
 !
INFO: MPV (cplayer):  (+) Video --vid=1 (*) (hevc 7680x3840 59.940fps)
INFO: MPV (cplayer):  (+) Audio --aid=1 --alang=eng (*) (aac 2ch 48000Hz)
INFO: Active hardware decoder: nvdec
INFO: MPV (decode_wrapper/vd): Using hardware decoding (nvdec).
INFO: MPV (cplayer): AO: [wasapi] 192000Hz stereo 2ch float
INFO: MPV (cplayer): VO: [libmpv] 7680x3840 cuda[nv12]
ERROR: ! MPV (libmpv_render): after creating texture: OpenGL error INVALID_VALUE.
 !

This happens both with forced hardware acceleration and without. When using the standalone mpv video player on the same video i get about 2% cpu usage mpv_player

Im using windows and an nvidia rtx 30-series card with intel 8th gen 6-core cpu

Thanks, Nodude

OpenFunscripter commented 3 years ago

You can create an mpv.conf at "C:\Users\my_user_name\AppData\Roaming\OFS\OFS_data\mpv.conf" and try to further tweak mpv you'll need atleast OFS version 1.2.1 for that. Try putting profile=gpu-hq in the mpv.conf and see if that helps.

If you want a true apples to apples comparison between OFS and the standalone player you would have to run the the standalone player with the OpenGL backend (which I'm guessing isn't default on windows but I don't know).

Other than that I can only recommend against using such high resoultions for scripting and say stick to lower resolutions.

OpenFunscripter commented 3 years ago

I did some testing on my own and I did experience similar results but I don't see anything I could do. I'm going to have to leave it at a recommendation not to use such high resolutions for scripting.

OpenFunscripter commented 2 years ago

Closing this because I can't control this.