Add delay to player

Azhar Ali

Member
Hi Max,

Another problem we are having is, rtmp_stream auto disconnects after roughly 2mins. In our case there might be times when noone is talking for several mins, as its a news service. How can we stop that? It doesn't happen for the WebRTC stream.
 

Max

Administrator
Staff member
Another problem we are having is, rtmp_stream auto disconnects after roughly 2mins. In our case there might be times when noone is talking for several mins, as its a news service. How can we stop that? It doesn't happen for the WebRTC stream.
If there are no subscribers to RTMP stream in 60 seconds by default, it will be stopped. So we recommend to inscrease this timeout to 12 hours for example (60 seconds * 60 minutes * 12 hours):
Code:
rtmp_activity_timer_timeout=43200000
 

Azhar Ali

Member
Hi max,

You misunderstood me..what I meant was client is connected to the rtmp stream but after 2mins it disconnects itself. As suggested above the rtp timer is also 2mins and its audio only stream. Could the video side of things disconnecting it as there are packets for that?
 

Max

Administrator
Staff member
You misunderstood me..what I meant was client is connected to the rtmp stream but after 2mins it disconnects itself. As suggested above the rtp timer is also 2mins and its audio only stream. Could the video side of things disconnecting it as there are packets for that?
Yes, it seems like you should disable video rtp activity detection on all servers
Code:
rtp_activity_video=false
 

Azhar Ali

Member
Thanks Max, that fixed the issue. Delay has been working nicely past couple days.

Thanks for all the help. Really appreciate the hard work you do.
 

Azhar Ali

Member
Hi Max,

We have been having issues between the quality of the sound between webrtc stream and LITE stream. We have a delay of 10sec using the buffer settings but the quality of sound is very poor on the rtmp but its crispy and clear on the webrtc.

I have emailed you the link of the recorded video, listen after 40seconds. Its audio-only stream

Also sent another video to show recordings from both WebRTC and rtmp version and there is a massive drop in the audio quality. Playing using the demo site of our servers. Link to the video is emailed.

First connect to rtmp version of the stream upto 25seconds in the recording.
Then connected to WebRTC version after 50seconds

Any idea?

Regards
Azhar
 
Last edited:

Max

Administrator
Staff member
Good day.
As seen from you video sample, you have a big packet losses while playing RTMP stream. Then, you reconnect to play WebRTC, and there are no packet losses. May be it was channel issue?
We tried to reproduce the issue with the latest WCS build, and can not reproduce. Please update to build 5.2.767 which includes some fixes concerning AAC to Opus audio transcoding, and check.
Also, please check if you applied the tweaks we recommended in this post.
 

Azhar Ali

Member
Hi Max,

What do you mean by channel issue? and what can we do about it?
Is updating the origin only enough?
I can confirm all the settings on the mentioned post are present.


Regards
Azhar
 

Max

Administrator
Staff member
What do you mean by channel issue? and what can we do about it?
Seems like you had a problems with channel between browser and server while testing, and some packets were lost. This lead to choppy sound.
If this randomly happens, you probably shold not do something with it. If this occurs regularly, check your network connection, check the last mile from you to provider, change the network or provider.
Is updating the origin only enough?
Yes, it shoud be enough
 

Azhar Ali

Member
Seems like you had a problems with channel between browser and server while testing, and some packets were lost. This lead to choppy sound.
If this randomly happens, you probably shold not do something with it. If this occurs regularly, check your network connection, check the last mile from you to provider, change the network or provider.
But if it was the ISP provider issue, it should happen on WebRTC as well. It's not a random issue, voice is continuously worse on the rtmp re-publishing
Today, I could not see any packet lost but the sound is still choppy.
Voice is very good on WebRTC but not on delayed rtmp re-published stream.
 

Azhar Ali

Member
Please provide SSH access to the server on which the problem is reproduced, we will check
We update the origin to latest version 768 and voice on rtmp seems to be good as well. Not sure why it went bad as when we deployed 744 few weeks ago, we didnt had any issues until last few days.
 

Max

Administrator
Staff member
We update the origin to latest version 768 and voice on rtmp seems to be good as well. Not sure why it went bad as when we deployed 744 few weeks ago, we didnt had any issues until last few days.
This is probably one of the audio transcoding issues fixed since build 5.2.764. That's why it can't be reproduced in latest builds.
 

Azhar Ali

Member
Hi Max,

We still experiencing choppy, crackly sound on rtmp stream. I have emailed you a video on the demo and SSH details for the origin and edge server (this is only one edge which runs these days). Please can we look into this? First day after the update it was fine but since last 2-3 days its back to crackly sound. Also the sound is louder between WebRTC and rtmp.

Regards
Azhar
 

Max

Administrator
Staff member
Good day.
Seems like you lost media_transponder.sdp tweak from this post on Origin server while upgrading it, so audio is resampled twice: from 48 kHz to 44.1 kHz when republishing as RTMP and back again when playing it on Edge server as WebRTC. Please note that media_transponder.sdp file should be placed to /usr/local/FlashphonerWebCallServer/conf folder
Also we recommend you to exclude all the audio codecs from CDN except Opus on Edge servers, to prevent excessive audio transcoding on Edges:
Code:
codecs_exclude_cdn=mpeg4-generic,alaw,ulaw,g729,speex16,g722,telephone-event,flv
In this case, only Opus will be translated between Origin and all the Edges.
This setting requires server restart, so you can also update Edges to the same build as Origin.
Unfortunately we cannot reproduce the issue while publishing test stream to your Origin server, republishing as RTMP with delay and playing from your Edge server.
If the issue happens under high load, please check if you allocated 1/2 of servers RAM to Java heap (for your Origin and Edge we checked the heap should be 8 Gb) and switched to ZGC garbage collector as described here (hugepages setup can be skipped).
If the tweaks does not help and the issue occurs again, please collect a report as described here including client debug logs and statistics page http://localhost:8081/?action=stat output on both Origin and Edge servers, and send us using this link, we will check the logs.
 

Azhar Ali

Member
Hi Max,
Will do the changes as you recommended. However, media_transponder.sdp does exists at location usr/local/FlashphonerWebCallServer/media_transponder.sdp. this is the location you asked to place the file but now you mentioned it should be inside usr/local/FlashphonerWebCallServer/conf. I will change its location but want to make sure which is the correct one.
Regards
Azhar
 

Azhar Ali

Member
Hi Max,

I made the changes but when I tried to get ZGC, server wouldn't start, do the following settings looks correct? Server's physical memory is 16GB.
### JVM OPTIONS ###
-Xmx8g
-Xms8g

# tried all the below combinations but server wouldn't start.
#-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms2g -Xmx8g -XX:+UseLargePages -XX:ZPath=/hugepages
#-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms4g -Xmx8g -XX:+UseLargePages -XX:ZPath=/hugepages
-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms8g -Xmx8g -XX:+UseLargePages -XX:ZPath=/hugepages
Updated all the settings and server to 768 apart from above ZGC activation. Will see how the performance goes tomorrow during the day. It does seem to be down to load as early in the day when less users are connected its fine and as more users starts to connect around 9am ET then sounds get crackly on rtmp
 

Max

Administrator
Staff member
Please do not enable large page usage by leaving just this:
Code:
-XX:+UnlockExperimentalVMOptions -XX:+UseZGC -Xms8g -Xmx8g
In this case, server will start
It does seem to be down to load as early in the day when less users are connected its fine and as more users starts to connect around 9am ET then sounds get crackly on rtmp
ZGC should help: it reduces garbage collection pauses and server CPU load.
 
Top