|
23 | 23 | - help you identify the maximum possible achievable quality at a given bitrate, resolution, and fps for your hardware |
24 | 24 | - identify maximum capabilities to be applied to OBS Studio, or author's |
25 | 25 | suggested [Game Streaming Software](#streaming-host--client-software-suggestions) for streaming games anywhere |
26 | | -- identify optimal encoder settings that allow you to squeeze the most quality out of a bitrate limited streaming environment, such as streaming to Twitch or Youtube at low bitrates |
| 26 | +- identify optimal encoder settings that allow you to squeeze the most quality out of a bitrate limited streaming |
| 27 | + environment, such as streaming to Twitch or Youtube at low bitrates |
27 | 28 |
|
28 | 29 | ### The Two Tools |
29 | 30 |
|
30 | | -- **benchmark** - one-click pre-configured encoding benchmark that runs on your chosen encoder, useful for a quick-check of your GPU's performance at various resolutions/framerates |
| 31 | +- **benchmark** - one-click pre-configured encoding benchmark that runs on your chosen encoder, useful for a quick-check |
| 32 | + of your GPU's performance at various resolutions/framerates |
31 | 33 | - **permutor-cli** - command-line tool to iterate over all possible encoder settings and bitrates to find |
32 | 34 | encoder limitations, in both performance and quality |
33 | 35 |
|
@@ -107,9 +109,14 @@ Assuming you have followed the [Installation Setup Requirements](#installation-- |
107 | 109 | benchmark is as simple as: |
108 | 110 |
|
109 | 111 | 1) Opening the **benchmark** executable as you would any other program (double-click) |
110 | | -2) Follow the on-screen instructions: select your GPU (if you have more than 1, otherwise it auto-selects your only |
111 | | - card), select your encoder, and whether to run it on all resolutions or just a specific |
112 | | - one |
| 112 | +2) Follow the on-screen instructions: |
| 113 | + |
| 114 | +- select your GPU (if you have more than 1, otherwise it auto-selects your only |
| 115 | + card) |
| 116 | +- select your encoder |
| 117 | +- select whether to run the benchmark on all resolutions or just a specific one |
| 118 | +- select whether you want to run it in verbose mode for extra logging (useful for error debugging) |
| 119 | + |
113 | 120 | 3) Wait for the benchmark to finish, which should not take that long |
114 | 121 |
|
115 | 122 |  |
@@ -228,44 +235,67 @@ your cards for you. |
228 | 235 |
|
229 | 236 | ## Applying your Findings |
230 | 237 |
|
231 | | -This section details out how to use knowledge you've gained from this tool in software like Sunshine, Moonlight, OBS Studio, and many more. |
| 238 | +This section details out how to use knowledge you've gained from this tool in software like Sunshine, Moonlight, OBS |
| 239 | +Studio, and many more. |
232 | 240 |
|
233 | 241 | ### Updating Encoder Settings in Sunshine |
234 | 242 |
|
235 | | -We'll first be discussing how to change encoder settings in Sunshine. Bitrate settings will not be something you can set in Sunshine, but will be something you can change in your Moonlight app on your computer or other streaming device. |
| 243 | +We'll first be discussing how to change encoder settings in Sunshine. Bitrate settings will not be something you can set |
| 244 | +in Sunshine, but will be something you can change in your Moonlight app on your computer or other streaming device. |
236 | 245 |
|
237 | | -As of February 2023, Nvidia is stopping support of it's own home GameStream service bundled with GeForce Experience. Introducing <a href='https://github.com/LizardByte/Sunshine/releases'>Sunshine</a>, the open-source alternative that runs on your gaming rig, and encodes your gameplay footage to be streamed to other devices, like another computer or even your phone. Sunshine, unlike other streaming programs like Nvidia's GameStream, allows you to customize some encoding settings that can often out-perform Nvidia's GameStream program. |
| 246 | +As of February 2023, Nvidia is stopping support of it's own home GameStream service bundled with GeForce Experience. |
| 247 | +Introducing <a href='https://github.com/LizardByte/Sunshine/releases'>Sunshine</a>, the open-source alternative that |
| 248 | +runs on your gaming rig, and encodes your gameplay footage to be streamed to other devices, like another computer or |
| 249 | +even your phone. Sunshine, unlike other streaming programs like Nvidia's GameStream, allows you to customize some |
| 250 | +encoding settings that can often out-perform Nvidia's GameStream program. |
238 | 251 |
|
239 | | -Note: we'll assume that you already have a Sunshine server setup and that you have attached at least one client device. Sunshine sets some encoder settings by default, at the time of writing this, for Nvidia encoders the default preset is `p4`. You can view the currently used encoder settings by going to `youripaddress:47990 -> Web UI -> Configuration -> NVIDIA NVENC Encoder / Intel QuickSync Encoder / AMD AMF Encoder`. |
| 252 | +Note: we'll assume that you already have a Sunshine server setup and that you have attached at least one client device. |
| 253 | +Sunshine sets some encoder settings by default, at the time of writing this, for Nvidia encoders the default preset |
| 254 | +is `p4`. You can view the currently used encoder settings by going |
| 255 | +to `youripaddress:47990 -> Web UI -> Configuration -> NVIDIA NVENC Encoder / Intel QuickSync Encoder / AMD AMF Encoder`. |
240 | 256 |
|
241 | | -Let's say that using the tools in this project, you identified that of all the possible encoder settings for NVENC_H264 on your 3080, the settings that allowed you to encode 4K@120 were: |
| 257 | +Let's say that using the tools in this project, you identified that of all the possible encoder settings for NVENC_H264 |
| 258 | +on your 3080, the settings that allowed you to encode 4K@120 were: |
242 | 259 |
|
243 | 260 | `-preset p1 -tune ll -profile:v high -rc cbr` |
244 | 261 |
|
245 | | -To apply these settings in Sunshine (for Nvidia), go to `Web UI -> Configuration -> NVIDIA NVENC Encoder` and change to the following values in the dropdowns: |
| 262 | +To apply these settings in Sunshine (for Nvidia), go to `Web UI -> Configuration -> NVIDIA NVENC Encoder` and change to |
| 263 | +the following values in the dropdowns: |
246 | 264 |
|
247 | 265 | ``` |
248 | 266 | NVENC Preset: p1 -- fastest (lowest quality) |
249 | 267 | NVENC Tune: ll -- low latency |
250 | 268 | NVENC Rate Control: cbr -- constant bitrate |
251 | 269 | ``` |
252 | 270 |
|
253 | | -You may have noticed that you could not set the profile for the encoder in Sunshine. Sunshine does not expose _all_ encoder settings, but exposes the ones that make the most impact to your encode (most likely Sunshine defaults profile to high). Perhaps in a future update you'll be able to specify more settings but, for now you may be limited. |
| 271 | +You may have noticed that you could not set the profile for the encoder in Sunshine. Sunshine does not expose _all_ |
| 272 | +encoder settings, but exposes the ones that make the most impact to your encode (most likely Sunshine defaults profile |
| 273 | +to high). Perhaps in a future update you'll be able to specify more settings but, for now you may be limited. |
254 | 274 |
|
255 | | -Once you've saved these settings, Sunshine will now encode your game using your specific settings, enabling you to stream at potentially higher framerates, or framerates with higher 1% lows than before. (Author was not able to get higher than 4K@90 with default settings in Sunshine and Nvidia's GameStreaming service, but with the findings from this tool, is able to get stable 4K@120). |
| 275 | +Once you've saved these settings, Sunshine will now encode your game using your specific settings, enabling you to |
| 276 | +stream at potentially higher framerates, or framerates with higher 1% lows than before. (Author was not able to get |
| 277 | +higher than 4K@90 with default settings in Sunshine and Nvidia's GameStreaming service, but with the findings from this |
| 278 | +tool, is able to get stable 4K@120). |
256 | 279 |
|
257 | 280 | ### Applying Bitrate Knowledge in Moonlight App |
258 | 281 |
|
259 | 282 | When using Moonlight as your game streaming client, it auto-recommends a bitrate for you to stream at. Most of the time |
260 | 283 | this is pretty accurate for lower resolutions, however depending on your hardware's capabilities you might be able to |
261 | | -get away with less bitrate than it suggests. Even moreso, some AMD GPU's need way more bitrate than Nvidia cards, so you'll want to know if you'll need much higher bitrates. |
| 284 | +get away with less bitrate than it suggests. Even moreso, some AMD GPU's need way more bitrate than Nvidia cards, so |
| 285 | +you'll want to know if you'll need much higher bitrates. |
262 | 286 |
|
263 | 287 | For example: Moonlight auto-selects `80Mb/s` for streaming 4K@60 game content. However from our testing, you really only |
264 | | -need `50Mb/s` when encoding using H264_NVENC. Notice that this applies to _nvenc_ encoders on Nvidia GPU's, and may or may not apply for other vendor GPU's, even using the same H264 algorithm. |
| 288 | +need `50Mb/s` when encoding using H264_NVENC. Notice that this applies to _nvenc_ encoders on Nvidia GPU's, and may or |
| 289 | +may not apply for other vendor GPU's, even using the same H264 algorithm. |
265 | 290 |
|
266 | | -After running the tool on a 4K@60 input file, we know we can get a visually lossless streaming experience with just 50Mb/s on our Nvidia GPU. We also know that, if we are attempting to stream our games outside our home network, we know that our cellular connection speeds or wifi speeds should be at least 50Mb/s to get a clean 4K@60. In addition to this, our gaming rig (and home network upload speeds) should also be capable of 50Mb/s. |
| 291 | +After running the tool on a 4K@60 input file, we know we can get a visually lossless streaming experience with just |
| 292 | +50Mb/s on our Nvidia GPU. We also know that, if we are attempting to stream our games outside our home network, we know |
| 293 | +that our cellular connection speeds or wifi speeds should be at least 50Mb/s to get a clean 4K@60. In addition to this, |
| 294 | +our gaming rig (and home network upload speeds) should also be capable of 50Mb/s. |
267 | 295 |
|
268 | | -The tools here enable you to know whether you can actually stream to where you are, or if you are bitrate limited, encoder hardware limited, or somewhere in-between. It's easier to know if you can stream games to your phone while on cellular data, and know what resolution & framerate to set your stream to given that you are bitrate limited. |
| 296 | +The tools here enable you to know whether you can actually stream to where you are, or if you are bitrate limited, |
| 297 | +encoder hardware limited, or somewhere in-between. It's easier to know if you can stream games to your phone while on |
| 298 | +cellular data, and know what resolution & framerate to set your stream to given that you are bitrate limited. |
269 | 299 |
|
270 | 300 | ### Streaming with OBS Studio |
271 | 301 |
|
|
276 | 306 | ## Author's Research Findings and Discussion |
277 | 307 |
|
278 | 308 | A _lot_ of research has gone into the development of this tool, and some decisions were made along the way that might |
279 | | -not be obvious to why some conclusions were drawn. This section is also for you if you are interested in some nitty-gritty details of video encoding, from SSD i/o read speed limitations, framerate statistics, and some design decisions of the tool made by the author during development. |
| 309 | +not be obvious to why some conclusions were drawn. This section is also for you if you are interested in some |
| 310 | +nitty-gritty details of video encoding, from SSD i/o read speed limitations, framerate statistics, and some design |
| 311 | +decisions of the tool made by the author during development. |
280 | 312 |
|
281 | 313 | ### Streaming Host & Client Software Suggestions |
282 | 314 |
|
|
0 commit comments