Skip to content

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

Merged
merged 2 commits into from
Feb 7, 2025
Merged

fix: ignore dtx streams #35

merged 2 commits into from
Feb 7, 2025

Conversation

desher
Copy link
Contributor

@desher desher commented Feb 7, 2025

Ignore streams encoded with DTX option due to high FPS volatility and false positive freezeCount results in WebRTC Stats.

@desher desher requested review from evgmel and panov-va February 7, 2025 09:20
stdDevThreshold = 30,
): boolean => {
const frameIntervals: number[] = [];
for (let i = 0; i < allProcessedStats.length - 1; i += 1) {
Copy link
Collaborator

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

return false;
}

const mean = frameIntervals.reduce((a, b) => a + b, 0) / frameIntervals.length;
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

const mean = frameIntervals.reduce((a, b) => a + b, 0) / frameIntervals.length;
const variance = frameIntervals
Copy link
Collaborator

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, done

Copy link
Collaborator

@evgmel evgmel left a 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 👍

@desher desher removed the request for review from panov-va February 7, 2025 10:46
@desher desher merged commit e37c2ff into master Feb 7, 2025
4 checks passed
@desher desher deleted the ignore-dtx-streams branch February 7, 2025 10:46
@vlprojects-bot
Copy link
Contributor

🎉 This PR is included in version 1.16.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants