-
Notifications
You must be signed in to change notification settings - Fork 16
fix: ignore dtx streams #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/helpers/streams.ts
Outdated
stdDevThreshold = 30, | ||
): boolean => { | ||
const frameIntervals: number[] = []; | ||
for (let i = 0; i < allProcessedStats.length - 1; i += 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i
should probably start from 1 (because previousVideoStreamStats are supposed to be a previous element of allProcessedStats
array)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/helpers/streams.ts
Outdated
return false; | ||
} | ||
|
||
const mean = frameIntervals.reduce((a, b) => a + b, 0) / frameIntervals.length; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use calculateMean()
function from helpers here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/helpers/streams.ts
Outdated
} | ||
|
||
const mean = frameIntervals.reduce((a, b) => a + b, 0) / frameIntervals.length; | ||
const variance = frameIntervals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving this code to a helper function for variance calculation? and may be event second one for standard deviation calculation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea, done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the refactoring 👍
🎉 This PR is included in version 1.16.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Ignore streams encoded with DTX option due to high FPS volatility and false positive freezeCount results in WebRTC Stats.