Closed dan64 closed 5 months ago
why does it happen?
I'm not sure about this, and I have idea to solve. Threading is done on the vapoursynth side, and not on the application side.
Try using --vpy-mt. It's much faster for me.
the parameter "--vpy-mt" is available only in QSVenc/VCEEnc.
EDIT: actually the parameter "--vpy-mt" is available also for NVEnc but is not included in the documentation. With this parameter the speed increase significantly and the problem is solved on my side.
Thanks
@rigaya
Dan
P.S. the parameter "--vpy-mt" should be added in the documentation regarding NVEnc options
I checked the code pretty quick and according to this code line VapourSynth should be run only with one thread as long as --vpy-mt
is not used:
https://github.com/rigaya/NVEnc/blob/d81bf9c6cc70ff59565d3a3878736b48ba157609/NVEncCore/rgy_input_vpy.cpp#L193
...whereas AviSynth is run without limitations: https://github.com/rigaya/NVEnc/blob/d81bf9c6cc70ff59565d3a3878736b48ba157609/NVEncCore/rgy_input_avi.cpp#L61
As VapourSynth itself uses multi-threading, I personally would prefer to have a --vpy
parameter that works like --vpy-mt
does right now - meaning using multi-threading. In case there is a need for a single-threaded run, I would suggest using --vpy-st
(Single Thread). Of course all over the 3 encoders.
If it's not intended to change that, the docs should be extended to make the differences more obvious.
Actually I forgot most of these implementations, as I've written so many years ago. I think it was that although --vpy-mt could enhance vapoursynth multi threading, there were cases that --vpy-mt smoehow failed, and I decided not to go into that further (and I will not). So --vpy is made default instead of --vpy-mt, and --vpy-mt not written in docs explicitly.
Actually it seems that I failed to remove --vpy-mt from QSVEnc docs.
For what it's worth, I've never had a problem with --vpy-mt, even with a ton of plugins, granted I haven't used it THAT much though.
Using option --vpy to directly feed a Vapoursynth script is much slower than using vspipe.
On my tests
NVEncC.exe --vpy -i test_script.vpy --fps 23.976 --codec h265 --profile main10 --level auto --tier high --sar 1:1 --output-depth 10 --vbr 0 --vbr-quality 27.00 --aq --aq-strength 1 --aq-temporal --gop-len 0 --ref 3 --nonrefp --bframes 3 --bref-mode each --mv-precision Q-pel --preset default --colorrange limited --colormatrix bt709 --cuda-schedule sync --psnr --ssim --output test.265
the movie is encoded in double time respect to vspipe
vspipe.exe "test_script.vpy" - -c y4m | NVEncC.exe --y4m -i - --fps 23.976 --codec h265 --profile main10 --level auto --tier high --sar 1:1 --output-depth 10 --vbr 0 --vbr-quality 27.00 --aq --aq-strength 1 --aq-temporal --gop-len 0 --ref 3 --nonrefp --bframes 3 --bref-mode each --mv-precision Q-pel --preset default --colorrange limited --colormatrix bt709 --cuda-schedule sync --psnr --ssim --output test.265
such a difference is not justified, why does it happen?
P.S. Probably you should open the script using more threads.