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 > Video Encoding > High Efficiency Video Coding (HEVC)
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th February 2020, 12:55   #1  |  Link
easy2Bcheesy
Moderator
 
easy2Bcheesy's Avatar
 
Join Date: Feb 2002
Posts: 643
Transitioning from x265 to Turing quality-based encoding

Hi everyone,

Has anyone managed to crack quality-based HEVC encoding on Turing? Here's how I produce content:

1. Edit in Adobe Premiere - 3840x2160 at 59.94fps
2. Export a ProRes intermediate
3. Use Handbrake to create x264/x265 encodes. I use CRF 18 with x264 an CRF 20 with x265, usually on medium preset

When editing at 1080p, I tend to export straight from Premiere using Voukoder, but this seems to be cripplingly slow at 4K.

Anyway, on point three, I could really benefit from transitioning from x265 to NvEnc, even if there is some file bloat. However, QP-based encoding even at QP24/25 seems to produce file sizes equivalent to x264, so I'm wondering if anyone has successfully made this transition.

With 4K content, editing workstations can be locked up for hours, while Turing blasts through 4K at 60fps. I can stand to take a hit on file size to a certain extent if we get this enormous time saving! Is there such a thing as a free - or free-ish - lunch?
easy2Bcheesy is offline   Reply With Quote
Old 21st February 2020, 02:25   #2  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
I know in ffmpeg you manually twiddle a few values:
Code:
  -spatial_aq        <boolean>    E..V...... set to 1 to enable Spatial AQ (default false)
  -temporal_aq       <boolean>    E..V...... set to 1 to enable Temporal AQ (default false)
  -zerolatency       <boolean>    E..V...... Set 1 to indicate zero latency operation (no reordering delay) (default false)
  -nonref_p          <boolean>    E..V...... Set this to 1 to enable automatic insertion of non-reference P-frames (default false)
  -strict_gop        <boolean>    E..V...... Set 1 to minimize GOP-to-GOP rate fluctuations (default false)
  -aq-strength       <int>        E..V...... When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive) (from 1 to 15) (default 8)
  -cq                <float>      E..V...... Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control (from 0 to 51) (default 0)
  -aud               <boolean>    E..V...... Use access unit delimiters (default false)
  -bluray-compat     <boolean>    E..V...... Bluray compatibility workarounds (default false)
  -init_qpP          <int>        E..V...... Initial QP value for P frame (from -1 to 51) (default -1)
  -init_qpB          <int>        E..V...... Initial QP value for B frame (from -1 to 51) (default -1)
  -init_qpI          <int>        E..V...... Initial QP value for I frame (from -1 to 51) (default -1)
  -qp                <int>        E..V...... Constant quantization parameter rate control method (from -1 to 51) (default -1)
  -weighted_pred     <int>        E..V...... Set 1 to enable weighted prediction (from 0 to 1) (default 0)
  -b_ref_mode        <int>        E..V...... Use B frames as references (from 0 to 2) (default disabled)
     disabled        0            E..V...... B frames will not be used for reference
     each            1            E..V...... Each B frame will be used for reference
     middle          2            E..V...... Only (number of B frames)/2 will be used for reference
  -dpb_size          <int>        E..V...... Specifies the DPB size used for encoding (0 means automatic) (from 0 to INT_MAX) (default 0)
But nvidia is very opaque on what the hq vs fast profiles actually mean. I suppose I should make a mini-app to see what features get returned when setting the profile, at least as of this driver version.
foxyshadis is offline   Reply With Quote
Old 21st February 2020, 10:16   #3  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 326
With NVEncC64 maybe start out with something like this for 2160p

Code:
 --codec h265 --preset quality --profile main10 --level 5.1 --vbrhq 0 --vbr-quality 0 --aq --aq-temporal --lookahead 32 --colormatrix bt709 --colorprim bt709 --transfer bt709
Play with the vbr-quality value until you find appropriate file size.
excellentswordfight is offline   Reply With Quote
Old 21st February 2020, 11:44   #4  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quality based encoding with NVEncC:
--vbrhq 0 --vbr-quality x
(set x for the quality level, e.g. 20)

Quality based encoding with ffmpeg:
-b:v 0k -cq x
(x defines the quality level, e.g. 20. Important to set -b:v 0k)
Sharc is offline   Reply With Quote
Old 22nd February 2020, 20:10   #5  |  Link
easy2Bcheesy
Moderator
 
easy2Bcheesy's Avatar
 
Join Date: Feb 2002
Posts: 643
Interesting results from NVEncC64 but dealing with command lines is a massive pain for me and will be difficult to roll out to my team - are there any GUIs that can do the job?

I can't seem to get these settings working in Handbrake and while the settings have visibility in Staxrip, I can't seem to change them with custom command lines :/
easy2Bcheesy is offline   Reply With Quote
Old 22nd February 2020, 21:45   #6  |  Link
Taurus
Registered User
 
Taurus's Avatar
 
Join Date: Mar 2002
Location: Krautland
Posts: 903
Quote:
and while the settings have visibility in Staxrip, I can't seem to change them with custom command lines :/
On the last page of the NVEncC options (Other) is a field where you can do your custom settings.
I dont know if this will override the main settings of the Gui.
Never tested this.
When you are ready with your tweaking build a template with your desired settings and voila...
ready for use .
Taurus is offline   Reply With Quote
Old 28th February 2020, 20:32   #7  |  Link
easy2Bcheesy
Moderator
 
easy2Bcheesy's Avatar
 
Join Date: Feb 2002
Posts: 643
Thanks for this, I'm still having issues with GUI support here but even with NvEncC64 command lines, I've got to say that Turing gets nowhere near to x265 quality in my tests based on challenging video game footage, even with a 20 per cent file size increase. It's a ton blurrier. Maybe it's the content I'm using, I'll do some further tests.
easy2Bcheesy is offline   Reply With Quote
Old 28th February 2020, 21:35   #8  |  Link
RanmaCanada
Registered User
 
Join Date: May 2009
Posts: 331
Quote:
Originally Posted by easy2Bcheesy View Post
Thanks for this, I'm still having issues with GUI support here but even with NvEncC64 command lines, I've got to say that Turing gets nowhere near to x265 quality in my tests based on challenging video game footage, even with a 20 per cent file size increase. It's a ton blurrier. Maybe it's the content I'm using, I'll do some further tests.
No as hardware encoding still can't beat software, at least at consumer level. It will take at least another generation before hardware ASICS can catch up to software. People are hoping that with AV1, that the hardware encoders will match the software right out of the gate.
RanmaCanada is offline   Reply With Quote
Old 29th February 2020, 08:34   #9  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
Quote:
Originally Posted by RanmaCanada View Post
No as hardware encoding still can't beat software, at least at consumer level. It will take at least another generation before hardware ASICS can catch up to software. People are hoping that with AV1, that the hardware encoders will match the software right out of the gate.
It's not so much the hardware as the fact that they won't let anything run at less than realtime, either 30fps or 60fps at any frame size, depending on the card, because that's 99% use case. As beefy as Turing is, there's only so much you can do in that budget.

Getting in contact with Nvidia directly and talking to an engineer, maybe obtaining some kind of NDA'd SDK that unlocks slower offline encoding, is probably the only way to get any better quality out of it.
foxyshadis is offline   Reply With Quote
Old 29th February 2020, 14:05   #10  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by easy2Bcheesy View Post
I've got to say that Turing gets nowhere near to x265 quality in my tests based on challenging video game footage, even with a 20 per cent file size increase. It's a ton blurrier. Maybe it's the content I'm using, I'll do some further tests.
And, for a fair(er) quality comparison one should actually use an ultrafast preset with x265 rather than medium or slow.
Sharc is offline   Reply With Quote
Old 5th March 2020, 18:27   #11  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,771
Quote:
Originally Posted by Sharc View Post
And, for a fair(er) quality comparison one should actually use an ultrafast preset with x265 rather than medium or slow.
Yeah. Comparing efficiency @ performance is really the key here, if the goal is to determine the optimal quality possible at a given perf.

Although HW GPU encoders often get used for video game recording, as performance gets a lot better moving encoding off the CPU on systems without that many cores. And obviously memory bandwidth hit is better not having to copy the rendered frames back to main memory. Different use scenarios can have very different performance parameters even on the same hardware.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Reply


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 05:12.


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