This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Hybrid is not using 100% CPU
#1
When encoding video, Hybrid only uses ~50% of the CPU resources. I do not have any thread restrictions set as far as I know. I'm using a Ryzen 9 5900X.
I am going from UHD HDR to FHD SDR x265 10bit. The only vapoursynth filter being applied is DG HDRtoSDR.
https://ibb.co/k8xFkh7

I took Selur's advice of increasing the complexity of the encode by raising --rd from 3 to 5, along with some other adjustments, but all it did was reduce the fps while still using ~50% CPU.

I also noticed on startup that Config -> Internals -> Handling "FFmpeg/MEencoder threads" incorrectly identified the core count as 24 (it's 12 cores, 24 threads) and the default value was set at 8. I increased the value to 24, but CPU still remained at ~50%.
https://ibb.co/pfctfyP

Hybrid is also not using maximum GPU for DGDecNV.

Debug is attached.
Encode settings are:
x265 --input - --output-depth 10 --y4m --profile main10 --opt-cu-delta-qp --subme 3 --limit-modes --no-open-gop --opt-ref-list-length-pps --b-intra --rc-lookahead 25 --lookahead-slices 0 --pass 1 --no-slow-firstpass --bitrate 2000 --opt-qp-pps --qpfile GENERATED_QP_FILE --limit-refs 3 --ssim-rd --rd-refine --rdoq-level 2 --psy-rdoq 1.00 --aq-mode 3 --no-cutree --limit-sao --no-repeat-headers --stats "C:\Users\Michael\AppData\Local\Temp\movie_generated.stats" --multi-pass-opt-analysis --multi-pass-opt-distortion --analysis-reuse-file "C:\Users\Michael\AppData\Local\Temp\movie_generated.analysis" --output NUL

x265 --preset slow --input - --output-depth 10 --y4m --profile main10 --opt-cu-delta-qp --no-open-gop --opt-ref-list-length-pps --b-intra --lookahead-slices 0 --pass 2 --bitrate 2000 --opt-qp-pps --rd 5 --ssim-rd --rd-refine --aq-mode 3 --no-cutree --limit-sao --no-repeat-headers --stats "C:\Users\Michael\AppData\Local\Temp\movie_generated.stats" --multi-pass-opt-analysis --multi-pass-opt-distortion --analysis-reuse-file "C:\Users\Michael\AppData\Local\Temp\movie_generated.analysis" --output "C:\Users\Michael\AppData\Local\Temp\movie.265"
Please, read the 'Infos needed to fix&reproduce bugs,..'-sticky before you post about a problem.
Reply
#2
I don't think you can do anything about the gpu usage, but increasing cpu usage might be possible, but it might not increase the encoding speed at all, since I suspect something in the process chain simply is bottlenecking the rest.

First thing you can do is try to figure out whether the bottleneck is the Vapoursynth script (probably) or the encoder.
Try the following:
  • start Hybrid
  • load your source
  • do your setting
  • check the Vapoursynth Preview
  • Assuming it worked correctly, close the 'Vapoursynth Preview', press 'Show Vapoursynth Script' and copy its content.
  • Create a text file, name it test.vpy and copy the content from above into it. (for example under "C:/Users/Michael/Desktop/test.vpy"
  • Open a Windows Command Prompt and call:
    "C:\Program Files\Hybrid\64bit\Vapoursynth\vspipe.exe" "C:/Users/Michael/Desktop/test.vpy" NUL -c y4m --progress
This is just the processing of the Vapoursynth script without the encoding.
How is the speed? CPU usage?
I suspect the Vapoursynth processing isn't the problem, but x265 simply isn't that fast.

Cu Selur
Reply
#3
Try enabling "x265->Misc->Threading&Co->Distributed->analysis" and "x265->Misc->Threading&Co->Distributed->motion estimation".

Quote:Config -> Internals -> Handling "FFmpeg/MEencoder threads"
won't change a thing since you are not using ffmpeg or mencoder. Smile

Cu Selur
Reply
#4
test.vpy threw an error that it could not open the index file
https://ibb.co/TwvRBvg

I had to set --lookahead-slices=4 to enable --pmode. It should have been set at 4 anyway, not 0. Woops!
But, enabling --pmode and --pme did increase the CPU usage to fluctuate between 65-75%.
https://ibb.co/NrYYn96

Better, but still not 100%. I do not see any bottlenecks as neither CPU, GPU, memory, nor disk are saturated.

Also, unrelated, even though I set --psy-rd=2 in Hybrid the output was 0. 
https://ibb.co/C95wHGq

I checked back and the value was not being passed into the encode settings. 
https://ibb.co/nD9kfkJ

Any value other than 2 (1.99, 2.01) was passed.
https://ibb.co/4285dD3

Ok, something weird may be going on with my machine. Normally Handbrake runs at 100% but I just tried it again and it is now also fluctuating only between 65-75%.
So for now I will consider --pmode and --pme a solution.

--psy-rd is still an open issue though.
Reply
#5
Quote:test.vpy threw an error that it could not open the index file
Then you either didn't check the Vapoursynth Preview, which creates the index file, or you closed Hybrid, which deletes the index file.

Quote:Also,
unrelated, even though I set --psy-rd=2 in Hybrid the output was 0.
psy-rd=2 is the default.
--[no-]psy-rd <0..5.0>        Strength of psycho-visual rate distortion optimization, 0 to disable. Default 2.0
source: x265 --fullhelp
which is why it's not shown in the command line, while 'x265->Misc->Random Stuff->Minimize command line' is shown.
This seems like a bug in x265,since it does not seem to set psy-rd=2.00 when it's not set explicitly in the command line. Confused
-> I'll write a workaround for it. (as a workaround, you can disable 'Minimize command line')

Cu Selur
Reply
#6
Thanks, I'll show the full command line. It's more useful to me anyway.

For some reason, when I enable --pmode, Hybrid changes --limit-refs to 1. When I change --limit-refs back to 3, the value I want, --pmode becomes greyed out. 
Are they non-compatible?
Reply
#7
Yes, pmode only works if '--limit-refs' <= 1, which is why Hybrid sets it to 1 if a value > 1 is set once pmode gets enabled.

Cu Selur
Reply
#8
Oh I see. I was reading < and > the wrong way lol. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)