Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > (HD) DVD, Blu-ray & (S)VCD > DVD & BD Rebuilder

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th July 2020, 06:19   #29601  |  Link
deadfrog
Registered User
 
Join Date: Mar 2009
Posts: 3
rtx2060

I just downloaded NVEncC 5.09 64 bit. I have a Ryzen 3900 with 128gb ram and a RTX2060. If someone could give me the command line they would like tested I can run it against Avengers endgame and see what kind of frames/sec I get.
deadfrog is offline   Reply With Quote
Old 10th July 2020, 12:07   #29602  |  Link
Mike-uk
Registered User
 
Join Date: Jun 2018
Location: Dorset
Posts: 164
Quote:
Originally Posted by deadfrog View Post
I just downloaded NVEncC 5.09 64 bit. I have a Ryzen 3900 with 128gb ram and a RTX2060. If someone could give me the command line they would like tested I can run it against Avengers endgame and see what kind of frames/sec I get.
--avhw --vpp-pad 0,276,0,278 -i F:\Movies\uhd2019\BDMV\STREAM\00014.m2ts --codec hevc --preset quality --profile main10 --output-depth 10 --repeat-headers --chromaloc 2 --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --master-display G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1) --qp-min 0 --vbrhq 0 --vbr-quality 25 --sar 1:1 --aud --pic-struct --vbv-bufsize 45000 --max-bitrate 48000 --gop-len 24 --slices 4 -o "D:\test\VID_00000.hevc
Mike-uk is offline   Reply With Quote
Old 10th July 2020, 18:17   #29603  |  Link
cartman0208
Registered User
 
Join Date: Jun 2010
Location: Germany
Posts: 205
I had to do some small corrections to make it work (with powershell):
Quote:
"C:\path\to\nvenc\nvencc64.exe" --avhw --vpp-pad 0,276,0,278 -i "X:\path\to\input.file" --codec hevc --preset quality --profile main10 --output-depth 10 --repeat-headers --chromaloc 2 --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" --qp-min 0 --vbrhq 0 --vbr-quality 25 --sar 1:1 --aud --pic-struct --vbv-bufsize 45000 --max-bitrate 48000 --gop-len 24 --slices 4 -o "X:\path\to\output.file"
Also I coudn't make out any difference in encoding speed between 32bit and 64bit version.
cartman0208 is offline   Reply With Quote
Old 10th July 2020, 22:12   #29604  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by cartman0208 View Post
Also I coudn't make out any difference in encoding speed between 32bit and 64bit version.
I also see no difference in speed between 32 bit and 64 bit. That makes sense, since the actual encoding is being done by hardware anyway.

The one thing I did notice is that (like x264 and x265) you can't use the 64 bit version with a standard (not "+" version) of AVISYNTH. So in BD-Rebuilder I will only be including the 32 bit version of NCEncc in the TOOLS folder.

I have NVENCC working reliably within BD Rebuilder. I'm now working on the function of sizing predictions for constant quality mode (CQM). Since prediction (X264/x265 CRF) never really worked well with HEVC sources in the past, I'm also fixing that in the prediction algorithm. There are a few other minor support functions that will have to be adjusted as well.

All-in-all I'm pretty pleased with what I'm seeing (especially for UHD sources). The only real disadvantage of NVENC is the lack of a true 2-pass mode. But I don't think that's ever likely with a HW encoder.
Quote:
"C:\path\to\nvenc\nvencc64.exe" --avhw --vpp-pad 0,276,0,278 -i "X:\path\to\input.file" --codec hevc --preset quality --profile main10 --output-depth 10 --repeat-headers --chromaloc 2 --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" --qp-min 0 --vbrhq 0 --vbr-quality 25 --sar 1:1 --aud --pic-struct --vbv-bufsize 45000 --max-bitrate 48000 --gop-len 24 --slices 4 -o "X:\path\to\output.file"
By the way, the only reason "--vpp-pad 0,276,0,278" was a part of that command line is because the file I was using was imported from an MKV and the black padding had been removed in the original MKV file. So, during import, BD-RB sensed the sizing irregularity and inserted the necessary padding to make it UHD-BD compliant. Some of the other portions of the command line (e.g. --master-display) can also be specific to a source (UHD-BD keeps track of it, and BD-RB pulls the information to make sure the reencode matches). With recent changes to NVENCC you would also want to add the "--repeat-headers" parameter to it if the output is targeted at a UHD-BD disc.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 10th July 2020 at 22:41.
jdobbs is offline   Reply With Quote
Old 11th July 2020, 14:18   #29605  |  Link
Mike-uk
Registered User
 
Join Date: Jun 2018
Location: Dorset
Posts: 164
Quote:
Originally Posted by jdobbs View Post
The only real disadvantage of NVENC is the lack of a true 2-pass mode. But I don't think that's ever likely with a HW encoder.
can you not do a CPU true first pass ??
ou can do 2-pass in a few popular encoding programs, but the .stats file that is created is blank. The only way I've found to actually get a true 2-Pass is to run the first pass on the CPU, save the stats file and then use that during a second pass using NVENC which is a cumbersome process. Every other way I've encountered is no different than a 1-pass encode.

Last edited by Mike-uk; 11th July 2020 at 14:22.
Mike-uk is offline   Reply With Quote
Old 11th July 2020, 22:14   #29606  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by Mike-uk View Post
can you not do a CPU true first pass ??
ou can do 2-pass in a few popular encoding programs, but the .stats file that is created is blank. The only way I've found to actually get a true 2-Pass is to run the first pass on the CPU, save the stats file and then use that during a second pass using NVENC which is a cumbersome process. Every other way I've encountered is no different than a 1-pass encode.
How can you get NVENC to read a stats file? I must have missed that parameter.

But, even if it could, running the first pass on the CPU kinda' defeats the purpose (speed) of NVENCC.

Right now all NVENCC can do is a 2-pass within a short range of frames... which isn't really a 2 pass. Honestly, though, I'm pretty satisfied with the output quality of 1 pass anyhow, and the CQM output looks really good.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 11th July 2020 at 22:18.
jdobbs is offline   Reply With Quote
Old 12th July 2020, 09:39   #29607  |  Link
cartman0208
Registered User
 
Join Date: Jun 2010
Location: Germany
Posts: 205
How do you make sure, you hit the requested target size?
I imagine thats pretty hard with CQM ...
cartman0208 is offline   Reply With Quote
Old 12th July 2020, 10:47   #29608  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by cartman0208 View Post
How do you make sure, you hit the requested target size?
I imagine thats pretty hard with CQM ...
Possibly using the same (or similar) prediction algorithm which has been available since long for CPU based x264 CRF encodes?
Sharc is offline   Reply With Quote
Old 12th July 2020, 16:04   #29609  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by Sharc View Post
Possibly using the same (or similar) prediction algorithm which has been available since long for CPU based x264 CRF encodes?
Yeah. I built a prediction algorithm for BD Rebuilder so it could do targeted sizing using CRF in X264/X265. So for NVENC, I just had to do a large group of sample encodes in order to build its prediction tables.

I've done several tests and it seems to be working well enough. I also modified the way in which HEVC sources are sampled -- AVISYNTH's SelectRangeEvery() was getting terrible picture glitches with hevc, and I couldn't use if for UHD-BD anyway, because it didn't support HDR.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 12th July 2020 at 16:08.
jdobbs is offline   Reply With Quote
Old 12th July 2020, 21:09   #29610  |  Link
cartman0208
Registered User
 
Join Date: Jun 2010
Location: Germany
Posts: 205
Quote:
Originally Posted by jdobbs View Post
Yeah. I built a prediction algorithm for BD Rebuilder so it could do targeted sizing using CRF in X264/X265. So for NVENC, I just had to do a large group of sample encodes in order to build its prediction tables.
You mean like: take a sample of 24 frames from every minute of the movie ?

Oh, and what I just noticed ... is BD-RB cabable of HDR10+ ?
(sorry if that topic came up already)
because MediaInfo shows me on very few movies
Quote:
HDR format : SMPTE ST 2094 App 4, Version 1, HDR10+ Profile A compatible
and after the BD-RB conversion:
Quote:
HDR format : SMPTE ST 2086, HDR10 compatible
Or did I miss a secret switch?
cartman0208 is offline   Reply With Quote
Old 12th July 2020, 21:49   #29611  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by cartman0208 View Post
You mean like: take a sample of 24 frames from every minute of the movie ?

Oh, and what I just noticed ... is BD-RB cabable of HDR10+ ?
(sorry if that topic came up already)
because MediaInfo shows me on very few movies

and after the BD-RB conversion:


Or did I miss a secret switch?
The AVISYNTH sampling is configurable. See HIDDENOPTS.TXT:
Code:
SAMPLE_GROUP=n		n = Number of frames in each sample group for CRF estimation
SAMPLE_SIZE=n		n = Number of frames in each sample for CRF estimation (size/group = sample percentage)
The default values change depending upon on source framerates. But typically they are a 1% sample (e.g. 24fps uses a 48 frame sample [SAMPLE_SIZE] for every 4800 frames [SAMPLE_GROUP]).

On an HEVC source (in the upcoming version) a sample M2TS is created which consists of a 1% sample across multiple locations within the source.

BD-RB supports HDR10 and Dolby Vision. I don't think I've looked at HDR10+ yet (it's been a while), but frankly I am skeptical of all of these "extensions" to HDR10 as I think they are getting ridiculous and may in the same category as "HD Audio" (which is nothing beyond a marketing gimmick that has been proven scientifically as nonsense). Of course that comment will likely result in responses from people with "magic ears" who will say how they can tell the difference (even though what they actually hear is increased baseline volume that the marketeers have implemented in HD audio to try and make it appear as if there is an actual difference). Double blind tests show that (other than the additional channels available available in HD formats) Dolby Digital 5.1 at 640Kbs is indistinguishable from an lossless original audio source. Okay, time to step down off my soapbox.

I suppose I will have to look at HDR10+ just to keep the wolves at bay. But my guess is it will soon be replaced by HDR10++ or HDR10+ super-duper-excellent or some such thing. Marketeers have no boundaries (or ethics).
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 12th July 2020 at 22:20.
jdobbs is offline   Reply With Quote
Old 13th July 2020, 08:08   #29612  |  Link
cartman0208
Registered User
 
Join Date: Jun 2010
Location: Germany
Posts: 205
thanks for the description.

From my limited knowlege ... HDR10+, almost like DolbyVision, adds dynamic metadata to adjust brightness scene-by-scene, while HDR10 only uses static metadata
cartman0208 is offline   Reply With Quote
Old 14th July 2020, 17:45   #29613  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
NVEncC v5.10 is out. Supporting multipass ... (didn't try yet)
Sharc is offline   Reply With Quote
Old 14th July 2020, 21:31   #29614  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by Sharc View Post
NVEncC v5.10 is out. Supporting multipass ... (didn't try yet)
What???

And I was close to posting a test version of BD-RB...

I think I'll test multipass first...
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net
jdobbs is offline   Reply With Quote
Old 14th July 2020, 22:05   #29615  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
I set it to --multipass 2pass-full and it shows it as set while it is running... but the speed seems identical and it appears to only do one pass. I think this may be a mode I read about previously (somewhere), where it does two passes on a limited subset of frames (the lookahead, maybe?). It wouldn't be considered as really two pass.

True two-pass encoding requires a look at the entire stream so bits can be allocated with the entire set of frames under consideration.

With that said, I'll do some testing and see if --multipass results in any noticable improvements.

[Edit] Curiouser and curiouser... you can even set --multipass 2pass-full when using CQM mode. How does that work?
And it appears that two-pass is ON no matter what settings you use. The encode shows 2pass-full mode even when I set --multipass none or --multipass 2pass-quater [SIC] It even says it is on if you leave the --multipass option off completely.

v5.10 is running a little slower than v5.09 and the output size with the same setting is a little larger with v5.10 (with the same CQM value)... so something has changed. I'm just not sure what. Maybe it's because 2 pass is stuck on no matter the setting? No idea.

So....

__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 14th July 2020 at 22:44.
jdobbs is offline   Reply With Quote
Old 14th July 2020, 22:43   #29616  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
it requires nvidia driver 445.87 or later (SDK API 10.0).
Can't test it as I am away from home ....

Edit:
Perhaps this explains it
https://github.com/rigaya/NVEnc/issues/248

Edit2:
NVIDIA's multipass description / definition:
https://docs.nvidia.com/video-techno...ame-phencoding

Last edited by Sharc; 14th July 2020 at 23:25.
Sharc is offline   Reply With Quote
Old 14th July 2020, 23:22   #29617  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by Sharc View Post
it requires nvidia driver 445.87 or later (SDK API 10.0).
Can't test it as I am away from home ....

Edit:
Perhaps this explains it
https://github.com/rigaya/NVEnc/issues/248
I'm currently using nvidia driver 451.48... so that's not it.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 14th July 2020 at 23:27.
jdobbs is offline   Reply With Quote
Old 14th July 2020, 23:29   #29618  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
NVIDIA's multipass explanation from their doc:
https://docs.nvidia.com/video-techno...ame-phencoding

Quote:
Multi pass frame encoding
When determining the QP to use for encoding a frame, it is beneficial if NVENC knows the overall complexity of the frame to distribute the available bit budget in the most optimal manner. In some situations, multi-pass encoding may also help catch larger motion between frames. For this purpose, NVENC supports the following types of multi-pass frame encoding modes:

1-pass per frame encoding (NV_ENC_MULTI_PASS_DISABLED)
2-passes per frame, with first pass in quarter resolution and second pass in full resolution (NV_ENC_TWO_PASS_QUARTER_RESOLUTION)
2-passes per frame, with both passes in full resolution (NV_ENC_TWO_PASS_FULL_RESOLUION).
In 1-pass rate control modes, NVENC estimates the required QP for the macroblock and immediately encodes the macroblock. In 2-pass rate control modes, NVENC estimates the complexity of the frame to be encoded and determines bit distribution across the frame in the first pass. In the second pass, NVENC encodes macroblocks in the frame using the distribution determined in the first pass. As a result, with 2-pass rate control modes, NVENC can distribute the bits more optimally within the frame and can reach closer to the target bitrate, especially for CBR encoding. Note, however, that everything else being the same, performance of 2-pass rate control mode is lower than that of 1-pass rate control mode. The client application should choose an appropriate multi-pass rate control mode after evaluating various modes, as each of the modes has its own advantages and disadvantages. NV_ENC_TWO_PASS_FULL_RESOLUION generates better statistics for the second pass, whereas NV_ENC_TWO_PASS_QUARTER_RESOLUTION results in larger motion vectors being caught and fed as hints to second pass.

Last edited by Sharc; 14th July 2020 at 23:33.
Sharc is offline   Reply With Quote
Old 14th July 2020, 23:37   #29619  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Thanks for that. That make sense. So it isn't really 2 pass encoding in the traditional sense at all -- it's just 2 passes on a single frame during that frame's encoding.

It looks to me like the new version of NVENCC keeps it in 2-pass-full no matter what setting you specify. I'm sure that's a bug... but probably not a bad one, since 2pass-full is likely the best option in most cases anyhow.

[Edit] I submitted a bug report on GITHUB related to the mode always staying 2pass-full. (or, at least, always reporting 2pass-full)

Interestingly, the encode seems to actually be faster on a UHD source on v5.10 vs. v5.09 -- even with 2pass-full always selected. I'm not sure that that might mean.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 15th July 2020 at 00:51.
jdobbs is offline   Reply With Quote
Old 14th July 2020, 23:45   #29620  |  Link
jdobbs
Moderator
 
Join Date: Oct 2001
Posts: 20,973
Quote:
Originally Posted by cartman0208 View Post
thanks for the description.

From my limited knowlege ... HDR10+, almost like DolbyVision, adds dynamic metadata to adjust brightness scene-by-scene, while HDR10 only uses static metadata
Just an interesting aside on this subject. NVENCC has an option built in in which the additional information associated with HDR10+ can be copied from the original file automatically during encoding.
__________________
Help with development of new apps: Donations.
Website: www.jdobbs.net

Last edited by jdobbs; 15th July 2020 at 00:40.
jdobbs is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:26.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.