Question / Help [solved] Connection to nginx+ffmpeg drops frequently

sneaky4oe

Member
A small update. After switching from nvenc to amf for streaming, I've been streaming for 2 months w/o disconnects.

Stream setup:
60d64fb0-e75a-4c24-9f50-1ab7ce7cef1b

60d64fb0-e75a-4c24-9f50-1ab7ce7cef1b
oncvNzd.png

Recording setup:
VoEGLvX.png

Advanced tab:
6O1WC5p.png

Video settings:
3tpcIcq.png

RTMP module for nginx:
https://github.com/sergey-dryabzhinsky/nginx-rtmp-module

ffmpeg is standard from ubuntu repo.

Current config (updated from time to time to match my current config):
https://pastebin.com/RazUZnMY
 
Last edited:

djandywdottv

New Member
I'm glad i found this thread. I would of never thought it could be a nvenc encoding issue. So i removed my 1080ti from my main rig. I've installed a rx 580 to encode with instead. Only issue when i load obs and go to the amd encoder options. I don't see the extra settings like you got. I'm gonna test it without the extra options. And see if it fixes my issue. It's not a sever hardware issue or a network prob. I've tried running it through 2 different high performance routers both multi core routers. pfsense router ddwrt router same results. If this works it's still better then running a capture card 2pc setup. Less audio issues less screen tearing. Cheaper overall also. Anyway i'll get back to you with my results in a few days. any input would be great cheers!!
4lcOi8W.png
 

sneaky4oe

Member
If advanced settings are missing, then it's supposedly a driver issue.

Another thing I've discovered in my researches is that on ubuntu 16.04 I need to have HWE kernel enabled. Without it I was geting drops even on AMD videocard, which is a shame.
 

djandywdottv

New Member
Thanks for the reply. I'll try to reinstall the amd driver and see if i can get the extra settings. Also thanks for the tip about 16.04 i'll remember that if i upgrade from 14.04.1
 

sneaky4oe

Member
I've no idea, I'm using windows 8.1 after 10 broke itself for the 3-d time this new year, and it has not this monitoring stuff in it.
But I'd say, if recordings look fine, there's nothing to worry about.
 

sneaky4oe

Member
Why? Videocards do the separate things. Nvidia drivers just generally behaves like a dick, but works for the most part if you don't update them from a stable version.

Nvidia powers up main 144hz 1440p monitor with game and my oculus.
AMD powers up 3 side 1080p monitors with VSR to 1440p (amd has smoother supersampling) with browser, stream previews, chats, discord etc.
 

sneaky4oe

Member
You can get a cheaper one from 4xx series. They have the same version of AMF on board. If you don't plan on to use it for gaming, then you just basically need an encoder, which 460 does just fine. :-D
Also, if to throw away my experience with reinstalling without HWE, it's been 7 months. I've just figured that HWE enabled on installation was mandatory for my card to connect stabilly. So I'd advise you to do the tests with nvidia - maybe HWE will save it too (it didn't for two other guys I was helping to set it up, yet worth to try on someone else's config).
 

djandywdottv

New Member
I'd rather spend a little more and get a card through amazon. That way if i have any issues i can return it without hassles. I'd get a used card but i don't wanna deal with the issues that might come with it. Also i'm not sure if hwe is enabled on 14.0.4.1 but i tried to install it. And it said unable to locate package. I think my best bet is the amd card. I'll keep testing the 580 if it works i'll grab that card.
 

Mark Weiss

Member
I'm having similar problems streaming to Griffon build of nginx on my internal gigabit LAN. Changed all cables twice to rule out a bad CAT6 cable. Streaming still remains far less stable than streaming to Youtube or Twitch. I get rock steady streaming over the internet. However, I can't seem to maintain stream for more than a couple minutes before OBS stalls when streaming to nginx. Ran some diagnostics and determined that my LAN and router can sustain 940mb/s throughput, so should not be a problem for a 2mb/s stream.
nginx per Doug Johnson's version came with worker processes = 2 in the conf file. I just changed that to 1. Didn't notice a difference yet. OBS stream still changing from green to orange and yellow and back to green frequently.

I downloaded this version of nginx, but it appears to be raw code, not a Windows executable. But I'd like to try it since you indicated it's solved the problem.
 

sneaky4oe

Member
I downloaded this version of nginx, but it appears to be raw code, not a Windows executable. But I'd like to try it since you indicated it's solved the problem.
For this case I was using linux with nginx running in it. It was not a solution for Windows. You can try docker or WSL however to host nginx inside a virtual linux in a Windows environment... It just looks like nginx RTMP module isn't stable enough for nvidia encoder for whatever reason. I moved away from this config since I moved to windows10 on gaming rig, as it doesn't support proper hardware resources distribution for OBS and my stream starts lagging if GPU is maxed out.
 

Mark Weiss

Member
did you set your workers to 1 ? post your nginx log.
The rtmp mopule does not work with multiple workers.
I think you have something there! Doug Johnson's nginx RTMP package comes out of the box with 2 worker threads in conf. and I've been dealing with random stalls and a lot of dropped frames in OBS while streaming to this server. I changed it to one worker thread four hours ago, and restarted nginx. Happy to say I've stream over 341,000 frames and zero dropped frames.
I'm still concerned that OBS' status indicator keeps rotating between green, yellow, orange and back to green constantly, but it hasn't stalled so far. In the next few days, if there are no dropped frames, I'm going to consider this fixed. Thank you for that obscure, but vital bit of information!
 
Top