In our custom module we implemented a monitor thread that checks every 4 seconds the bitrate of the incoming stream so in case the bitrate is too low or there is some kind of problem with the stream we can disconnect the broadcaster and move on.
However after implementing this we noticed that good broadcasters were being dropped as well.
I then changed it to just log when it thought it should disconnect based on bitrate and I saw that sometimes for 10-15 and sometimes up to a full minute the bitrate went down to 0 and then went back up.
What I use to monitor the bitrate is the following:
monitoredStream = thisAppInstance.getStreams().getStream(STREAM_NAME);
IOPerformanceCounter perf = monitoredStream.getMediaIOPerformance();
Double bitrate = perf.getMessagesInBytesRate() * 8 * .001;
Any idea how this can happen? Is there a more reliable way to monitor the incoming stream quality?