Tweak your Windows Network Settings for NGINX
If you already used nginx for your rtmp streams, you might have also encountered problems with network stability or framedrops. Chance is, if you use Windows in your setup, you can tweak your network settings and maybe gain enough network performance for a smooth and steady experience.
To do this we have to change some settings in our registry:
Found by Timothy003 on the OBS forums, the above command increases the “DefaultSendWindow” which can allow ffmpeg/nginx to send out the stream at higher and more constant rates. Try this if you had problems pushing your stream to Twitch or a similar service.
Below I copied settings from the ECSDS guys, they create awesome windows builds for nginx. It tweaks a few different tcpip parameters and is suplied by them with their builds.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters] "TcpWindowSize"=dword:0000faf0 "MaxUserPort"=dword:0000F000 "TcpTimedWaitDelay"=dword:0000001e "MaxFreeTWTcbs"=dword:000003E8 "MaxHashTableSize"=dword:0000800 "MaxFreeTcbs"=dword:0000800 "TcpNumConnections"=dword:00fffffe
Now normally I would always recommend to make a backup of your registry before changing these values, but by default they are, to my knowledge, not set at all. Which means, if you want to revert the changes later, simply remove the values from the registry.
There are also different options available that come with nginx and should also work on linux. They are described in the nginx-rtmp-module directives and can be added/changed in the nginx.conf. See here. Chunk_Size and Max_Message are probably the most interesting in this case. For example if you had the “Too big” error. [And probably the options that come directly from nginx (not the rtmp module)]