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

add framesInput stats to rtcoutboundrtpstreamstats #761

Closed
bdrtc opened this issue May 31, 2023 · 6 comments
Closed

add framesInput stats to rtcoutboundrtpstreamstats #761

bdrtc opened this issue May 31, 2023 · 6 comments

Comments

@bdrtc
Copy link
Contributor

bdrtc commented May 31, 2023

we have originating frames of video source from rtcvideosourcestats , but lack stats the frames input to video encoder, video frame may be dropped before input to encoder, and frames encoded not equal to frames Input(encoder may drop frame) also.

@henbos
Copy link
Collaborator

henbos commented May 31, 2023

The source stats are the number of frames inputted to WebRTC and frames encoded are the number of frames outputted from the encoder, so in that sense you can calculate the number of frames that disappeared already.

What exactly do you want to measure?

What you can't tell is why the encoder did not produce more frames, but I guess that would either be because of the adaptation logic purposefully dropping them or the encoder dropping them due to not wanting to overshoot the bitrate? Both of these would be considered adaptation in my opinion.

@bdrtc
Copy link
Contributor Author

bdrtc commented Jun 1, 2023

the originating frame maybe dropped before inputed to encoder, with input frames stats, user can measure how many frames was dropped before encode , and how many frames dropped by encoder(for rate limiting purposes), this allow users to more accurately analyze the cause of low output frame rate.

@henbos
Copy link
Collaborator

henbos commented Jun 1, 2023

Frames dropped prior to delivery to WebRTC, e.g. something in the camera pipeline, should be available by the new track stats API (the shape and name of it is still up for debate) but ultimately the track should report its own frame rate. The new API is proposed on the MediaStreamTrack rather than on WebRTC because the consumer of the track may be a different use case than WebRTC and those use cases may still want to know about track stats.

As for WebRTC getStats, ideally the frame rate of "media-source" stats should match the output of the track if no frames are dropped by the capture pipeline. However there is currently a bug in the implementation of media-source stats where we report frame rate and resolution after adaptation, not before adaptation, so you're getting input to encoder rather than input to adaptation module. https://crbug.com/webrtc/13528

And lastly you have output from encoder.

@henbos
Copy link
Collaborator

henbos commented Jun 1, 2023

Would "capture fps -> webrtc input fps -> encoder fps" cover enough ground?

@bdrtc
Copy link
Contributor Author

bdrtc commented Jun 2, 2023

Frames maybe dropped before being sent to the encoder for various reasons(source、congestion、rate limit), stats dropped frames for every dropped reseaon may be more complicated, i think this(capture fps -> webrtc input fps -> encoder fps) is acceptable.

@henbos
Copy link
Collaborator

henbos commented Jun 2, 2023

Ack! Closing as covered by other specs/efforts. I'll be looking into implementing track stats, hopefully next quarter, in chrome

@henbos henbos closed this as completed Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants