OBS Reconnecting, clients dropping connection

Koen

New Member
Hi,
I have the following setup:
1 streaming computer in the office with the following specs:
  • Intel Core i7-7820X (8 cores, 16 threads)
  • 32GB RAM
  • NVMe SSD's
  • Gigabit networking to modem
  • Office network connection has 500Mbps downstream, 40Mbps upstream
  • Windows 10 Pro
  • OBS Studio 22.0.2
1 WCS Server in the datacenter:
  • 4 Cores
  • 8GB of RAM
  • SSD Storage
  • Running version v. 0.5.28.2747 - 5.1.3527-6f565...890c
I configured OBS:
  • RTMP to WCS
  • Constant bitrate of 1500 kbps (1.5Mbit)
  • Rescaled output to 852x480
  • Keyframe interval 1 second
  • CPU Usage preset Ultrafast
  • Profile "main"
  • Tune for "zerolatency"
  • x264 encoder
  • No recording
When streaming, CPU usage on the streaming PC is about 1-2% used.
The problem is that OBS reconnects every 30 seconds to 1 minute for some reason. I already tried these settings in flashphoner.properties:
Code:
#OBS keepalive fix
keep_alive.enabled=websocket,rtmfp
keep_alive.algorithm=NONE
Because of the reconnects, the clients seem to drop the connection most of the time as well. I'm using the default embedded player in an iframe. When I stream some background music, I also notice that the voice sometimes sounds slower or faster then it should.
The problem isn't bandwidth. I'm getting a very stable 38Mbit upstream from the streaming PC to the server, tested using "iperf"

When I put nginx with RTMP module between the streamer and WCS (having nginx push the rtmp back out to WCS port 1935), the connection between the streamer and nginx is rock solid: no reconnects, no dropped frames, everything seems perfect, except the clients (the players) still disconnect after a while, though it's better. Most of the time either the video or the audio stops and the other keeps playing, until eventually this also disconnects. This might take a few minutes or several hours.

Any ideas on how to fix this or what I can try next? Note that the super low latency is extremely important for our use-case.

Thanks in advance,
K.
 

Max

Administrator
Staff member
Hello.
Please do the following:
1. Update to lates version from this page (in version you use keep_alive.enabled setting does not work).
2. Remove from WCS_HOME/conf/flashphoner.properties file keep_alive.algorithm=NONE setting to prevent players disconnection.
 

Koen

New Member
Hello Max,
I've updated to the latest version (v. 0.5.28.2747 - 5.1.3583-a9f0...d070d) as requested, and removed the line with
Code:
keep_alive.algorithm=NONE
from flashphoner.properties.
  • In the few minutes that I've been testing with a client, the player hasn't disconnected yet.
  • Audio is still pretty choppy, going faster or slower than it should be at times. It should be noted that I only experience this when viewing the feed with the web player. If I use a desktop tool like "ffplay" and connect to the RTMP stream on WCS then I don't hear the speedup/slowdown of the audio.
    audio comes in in AAC format 44.1Khz stereo and according to ffplay it gets downmixed to speex 16Khz (might be for a good reason, I have no idea,...). Is this typical for the speex format to have the speedup/slowdown issues?
  • I can provide a URL where you can hear the stream if needed.
 

Max

Administrator
Staff member
By default if you play stream using Flash (RTMP) client, it uses Speex16 audio codec for playback.
You are right AAC 44.1 khz is transcoded and downsampled to Speex 16 Khz.
To prevent transcoding you can configure SDP file:
https://docs.flashphoner.com/display/WCS5EN/SDP settings files#SDPsettingsfiles-flash_handler_play.sdp

1. Replace
Code:
m=audio 0 RTP/AVP 97 8 0 108 96 109 98 99 100 102 103 104
with
Code:
m=audio 0 RTP/AVP 108 96 109 98 99 100 102 103 104 97 8 0
to set priority for AAC (mpeg4-generic).
or completely remove payloads 97, 8, 0 from SDP to proceed with AAC only

2. Put the file flash_handler_play.sdp into WCS_HOME/conf dir and restart WCS server.
 
Top