Skip to content
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

RTCVideoSourceStats.framesPerSecond should be a double #540

Closed
dontcallmedom opened this issue Feb 3, 2020 · 3 comments
Closed

RTCVideoSourceStats.framesPerSecond should be a double #540

dontcallmedom opened this issue Feb 3, 2020 · 3 comments

Comments

@dontcallmedom
Copy link
Member

All the fields framesPerSecond as defined as double except in RTCVideoSourceStats where it is defined as an unsigned long.

dontcallmedom added a commit to dontcallmedom/webrtc-stats that referenced this issue Feb 4, 2020
as other definitions of framesPerSecond members in other stat objects
close w3c#540
dontcallmedom added a commit to dontcallmedom/webrtc-stats that referenced this issue Feb 5, 2020
as other definitions of framesPerSecond members in other stat objects
close w3c#540
@vr000m vr000m closed this as completed in 9c60a98 Feb 5, 2020
@alvestrand
Copy link
Contributor

Wonder if we did this right. The definitional text for these entries says that it's a count, not a calculation ("number of frames ... in the last second").
Implementation has it somewhat approximate, though, so double may be more fitting.

Suggest to leave it as is, but wanted to record the doubt.

@bc-lee
Copy link

bc-lee commented Nov 8, 2021

This is not only a problem with RTCVideoSourceStats.framesPerSecond, but also with RTCInboundRtpStreamStats, RTCOutboundRtpStreamStats.
hbos already asked how FPS is calculated when the two words "last second" were introduced at #209.

@vr000m
Copy link
Contributor

vr000m commented Jan 26, 2022

I think the intention of the metric to return the latest Or current FPS for frames received in the last second.

Much like round trip time, which also returns the latest RTT measurements.

So this is invariant to how often you call getStats, it would always return the current value.

Otherwise, I'd recommend that we use the delta of framesSent and/or framesDecoded between two getStats API calls to calculate that interval's FPS.

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

No branches or pull requests

4 participants