It happens more often when publishing a video from an iPhone. After about 2 minutes, the FPS comes back to normal. Also, if I stop and start video streaming after sharing a file, the FPS is great.
Small files don’t cause this issue.
I wonder if there is a potential that it could be something that Mediasoup can handle more gracefully?
Seems that bitrate drops. Producer stats before file upload:
Wonder if there is a way to reset bandwidth estimator without closing and starting a new video producer? I can see there is this->remoteBitrateEstimator.reset( call in mediasoup package but it’s called only on timeout and after new producer is created.
I’ll definitely switch to v3 soon but since the switch is time-consuming, I hope there is a way to fix the issue in v2. From what you are saying though, I assume it’s not that easy to fix without hacks.
There is not fix possible. REMB is slow and there is no way to “reset the bandwidth estimator” because the user may consider that it has better uplink than the one reported by REMB. The problem is REMB and that’s why we added Transport-CC in v3.
I know mediasoup v2 isn’t supported but I’ve found something interesting you might want to know.
The problem doesn’t seem to be related to uploading files at all! When I comment these following code out + make sure I pause producer and resume producer + replaceTrack, the FPS isn’t affected at all. One problem with this though is it will probably only work with iPadOS. I assume iOS will not let me successfully call getUserMedia when previous tracks aren’t stopped but I’ll double check that.
Anyway I insist that the problem would not happen using v3.
Thanks!
Just an update for those who is going to read this thread. Pausing producer doesn’t help and doesn’t cause this issue. It’s the fact that video stream isn’t coming to Mediasoup while producer/transport are still alive. And probably the reason why it’s happening is because getUserMedia() takes 0.5 seconds in Safari Mobile (haven’t tried reproducing in Android Chrome). In overall, the stream isn’t happening for 1.5 seconds in my case and it causes the issue with FPS sometimes. When I increase it to 5 seconds, it’s much easier to reproduce.