2-pass H.265 NVENC Encoding - Windows vs Linux

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Harbinger
Posts: 3
Joined: Thu Sep 24, 2020 7:45 pm

2-pass H.265 NVENC Encoding - Windows vs Linux

Post by Harbinger »

I've been moving back and forwards between the Windows and Linux versions of Handbrake, and discovered that while I'm able to perform a two-pass H.265 NVENC encode under Linux (which produces fantastic results), I can only do a single pass encode under Windows (no option visible when H.265 NVENC is selected). I'm running Elementary OS 5.1.7 Hera and the Linux version of Handbrake was downloaded via Flathub.org. The Linux rig is using a Geforce GTX 1070, while the Windows system is running a Geforce RTX 2080 Ti.

It's no big deal, as I can always switch back to Linux for this one type of encoding task.
User avatar
s55
HandBrake Team
Posts: 9829
Joined: Sun Dec 24, 2006 1:05 pm

Re: 2-pass H.265 NVENC Encoding - Windows vs Linux

Post by s55 »

2-pass under linux isn't doing two pass. It's just wasting CPU cycles on the first pass decoding frames.
It's an bug in the GUI if it's displaying the option.

The hardware doesn't support true 2-pass encoding.

They have a "pre" analysis "2pass" mode which can be enabled in extra arguments "2pass=1". It's not going to get you the same kind of results as you'd get with x264/5 but it may offer a mild improvement.

That said, on the 10 series cards atleast, it doesn't appear to do anything.
Harbinger
Posts: 3
Joined: Thu Sep 24, 2020 7:45 pm

Re: 2-pass H.265 NVENC Encoding - Windows vs Linux

Post by Harbinger »

I'm doing 4K encodes right now, and have managed to compare the results between single pass on Windows and (pseudo) two-pass under Linux, and there's definitely a small, albeit subjective quality improvement. I didn't activate any additional arguments under both the Windows or Linux version of Handbrake, so I'm not sure why this appeared under Linux.

Anyway, thanks for the explanation.
User avatar
s55
HandBrake Team
Posts: 9829
Joined: Sun Dec 24, 2006 1:05 pm

Re: 2-pass H.265 NVENC Encoding - Windows vs Linux

Post by s55 »

Then something else is different. 2-pass is literally doing nothing on Linux.

Either a setting is different, or maybe the drivers aren't behaving consistently, or the default preset for the underlying encoder is different on Linux vs Windows.

I'd also note, RX2080 vs 1070 will give different results for sure. Encoder is marketed as being better under the RTX series.
User avatar
s55
HandBrake Team
Posts: 9829
Joined: Sun Dec 24, 2006 1:05 pm

Re: 2-pass H.265 NVENC Encoding - Windows vs Linux

Post by s55 »

I just did a quick test. The output file 1 pass vs 2pass is identical. It looks like it is just running the encode twice on linux which is a waste of electricity.
Harbinger
Posts: 3
Joined: Thu Sep 24, 2020 7:45 pm

Re: 2-pass H.265 NVENC Encoding - Windows vs Linux

Post by Harbinger »

The only other thing I can think of is when I started to install Handbrake on Linux, I followed the instructions in the forum but since I'm relatively inexperienced in Linux (haven't used it regularly in over two decades), I ended up getting stuck trawling through all those terminal commands! I eventually gave up, but found it on Flathub instead. It's possible there was a clash between my partial install via the terminal and the Flatpak file, which somehow screwed up the settings.

Yeah, I read something about RTX cards supporting B-frames which is supposed to improve H.265 encoding. Will need to take a closer look at that.
Post Reply