Question / Help x264 vs NVENC for high bitrate streaming (YouTube 1440p)

xbam

New Member
The age old question of x264 vs NVENC. I read all of the posts around this and x264 is better especially at lower bitrates like when streaming to Twitch. But how about using NVENC when streaming to YouTube at higher bitrates? I stream 1440p to YouTube sending them a 50,000 bitrate feed. I have 1gbps fiber connection so I could even stream at higher rates. Since YT transcodes anyway and I have plenty of bandwidth to spare, I figure why not send them a high quality raw file to transcode from.

I was wondering if anyone had any thoughts, experiences with high bitrate YT streaming? At 50,000 is there any point of using x264 and putting strain on my CPU or switch to NVENC? I've tried both and to me they look the same, quality wise, but I was hoping someone can provide more input/feedback on this topic.
 

pie9

New Member
The argument whether x264 or NVENC is better is highly conditional.

x264 is a software encoding method that uses your processor to encode the stream.

NVENC is a hardware encoding method using a dedicated chip built into GTX 1050 NVIDIA graphics cards and better, as well as several older generations of GTX cards.

x264 can use very little CPU to a lot of CPU, depending on which CPU preset you choose, as well as the bitrate you are attempting to encode at. If you encoded using x264 Veryslow, 50000 bitrate, you will be using an insanely higher percentage of your CPU than if you were streaming at x264 Ultrafast, 500 bitrate. These are two polar opposites. Most computers would crumble at Veryslow/50k bitrate.

Each CPU preset or encoder has a certain bitrate effectiveness or efficiency. x264 Ultrafast is the most lightweight CPU encoder but it's the least bitrate efficient. NVENC is somewhere between x264 Superfast and Veryfast, but it doesn't use much CPU at all. It uses the dedicated chip on the GPU.

If you were to try encoding at 50k bitrate on Ultrafast, Superfast or Veryfast, you would still use your CPU when you may not need to.

NVENC will be the best encoder to use at such a high bitrate for recording where you need the recording to be uploaded.

The bitrate you're talking about using is still quite high for what you're looking to achieve. Your bitrate should be scaled around what resolution, FPS and encoder you plan on using.

If you are using 2560x1440x30 (30 FPS), you're pushing 110,592,000 pixels per second through the encoder.

For streaming, people usually aim between 7% to 12% bits per pixel depending on how much activity is going on and what x264 preset they can accomplish. 12% bits per pixel is often very high quality on Veryfast.

If you aimed for 15% bits per pixel for 2560x1440x30, your bitrate would be 16,588.

For 2560x1440x60, 15% bits per pixel would equal a bitrate of 33,177.

15% bits per pixel should give you amazing quality on NVENC, so even 2560x1440x60 would look amazing at 34k bitrate.

As you get into higher resolutions and FPS, you require a lower scaled percentage of bitrate for the quality to still look crisp. 2560x1440x60 at 30k bitrate on NVENC is still likely very good quality. I imagine it should look no different visually than 50k bitrate.

Your bitrate doesn't only mean how long it will take to upload a video to YouTube. It's also how much data will be taken up on your drives and how the source quality will be downloaded for people watching the video online.

I'm not sure if YouTube automatically transcodes the video upon upload but I imagine the source quality will still be 50k bitrate and the transcoded versions available to people watching the videos will be scaled down lower than that. Regardless, lowering the bitrate from 50k to 34k should result in basically no visual difference but people should be able to watch the videos in a higher quality with the same connection.

In short, use x264 with the bitrate you desire and the best x264 preset your CPU can pull off without stuttering for streaming.

For recording, use NVENC at a much higher bitrate.
 
Last edited:

alpinlol

Active Member
The argument whether x264 or NVENC is better is highly conditional.

x264 is a software encoding method that uses your processor to encode the stream.

NVENC is a hardware encoding method using a dedicated chip built into GTX 1050 NVIDIA graphics cards and better, as well as several older generations of GTX cards.

x264 can use very little CPU to a lot of CPU, depending on which CPU preset you choose, as well as the bitrate you are attempting to encode at. If you encoded using x264 Veryslow, 50000 bitrate, you will be using an insanely higher percentage of your CPU than if you were streaming at x264 Ultrafast, 500 bitrate. These are two polar opposites. Most computers would crumble at Veryslow/50k bitrate.

Each CPU preset or encoder has a certain bitrate effectiveness or efficiency. x264 Ultrafast is the most lightweight CPU encoder but it's the least bitrate efficient. NVENC is somewhere between x264 Superfast and Veryfast, but it doesn't use much CPU at all. It uses the dedicated chip on the GPU.

If you were to try encoding at 50k bitrate on Ultrafast, Superfast or Veryfast, you would still use your CPU when you may not need to.

NVENC will be the best encoder to use at such a high bitrate for recording where you need the recording to be uploaded.

The bitrate you're talking about using is still quite high for what you're looking to achieve. Your bitrate should be scaled around what resolution, FPS and encoder you plan on using.

If you are using 2560x1440x30 (30 FPS), you're pushing 110,592,000 pixels per second through the encoder.

For streaming, people usually aim between 7% to 12% bits per pixel depending on how much activity is going on and what x264 preset they can accomplish. 12% bits per pixel is often very high quality on Veryfast.

If you aimed for 15% bits per pixel for 2560x1440x30, your bitrate would be 16,588.

For 2560x1440x60, 15% bits per pixel would equal a bitrate of 33,177.

15% bits per pixel should give you amazing quality on NVENC, so even 2560x1440x60 would look amazing at 34k bitrate.

As you get into higher resolutions and FPS, you require a lower scaled percentage of bitrate for the quality to still look crisp. 2560x1440x60 at 30k bitrate on NVENC is still likely very good quality. I imagine it should look no different visually than 50k bitrate.

Your bitrate doesn't only mean how long it will take to upload a video to YouTube. It's also how much data will be taken up on your drives and how the source quality will be downloaded for people watching the video online.

I'm not sure if YouTube automatically transcodes the video upon upload but I imagine the source quality will still be 50k bitrate and the transcoded versions available to people watching the videos will be scaled down lower than that. Regardless, lowering the bitrate from 50k to 34k should result in basically no visual difference but people should be able to watch the videos in a higher quality with the same connection.

In short, use x264 with the bitrate you desire and the best x264 preset your CPU can pull off without stuttering for streaming.

For recording, use NVENC at a much higher bitrate.
Kind of a contradiction in the end since OP wants to stream to youtube with a high Bitrate. That takes the Bitrate question out of the equation since he has plenty headroom anyway. As long as Youtube is fine with an throughput of 50k Bitrate then its better for your general game performance to use NVENC instead of x264 although if by any chance Youtube says no and wants you to stream at something like 15k Bitrate then you most likely have to revert back to x264
 

xbam

New Member
Thanks for the replies and I appreciate the long write up pie9. At the end of the day, I am probably pushing more bitrate than I need to, but as alpiniol said I have plenty of headroom so I figure why not send more than I need just to ensure I deliver the best quality source for YT to transcode.

I should mention also that I use a 2 PC setup, so all of the encoding is done on the streaming PC and doesn't impact my gaming performance if I do run x264. I guess then the question is at such high bitrate of 50,000, does it matter if I use x264 and put the work on the CPU, or go with NVENC and not strain the CPU cause NVENC looks just as good?
 

Kescarte_DeJudica

New Member
Thanks for the replies and I appreciate the long write up pie9. At the end of the day, I am probably pushing more bitrate than I need to, but as alpiniol said I have plenty of headroom so I figure why not send more than I need just to ensure I deliver the best quality source for YT to transcode.

I should mention also that I use a 2 PC setup, so all of the encoding is done on the streaming PC and doesn't impact my gaming performance if I do run x264. I guess then the question is at such high bitrate of 50,000, does it matter if I use x264 and put the work on the CPU, or go with NVENC and not strain the CPU cause NVENC looks just as good?

Hey xbam!

First of all, congratulations! I would do the exact same thing you are doing if I lived in an area with 1gb of internet speed.

The annoying part is, I am about 5-10 miles out of range from that speed, and have to take a 110 down ~ 11 up speed instead -_-. Oh well, maybe in time, I can move....


To answer your question, at your current bitrate, NVENC and x264 are essentially the exact same quality. The NVENC encoder is far more efficient in terms of performance impact, it only needs a much, much higher bitrate to produce the same result. You have that higher bitrate, so you will be all good to go!

BTW, would you please link me your YouTube channel? I would love to check it out!
 
Top