Coder Social home page Coder Social logo

Comments (5)

jan-ivar avatar jan-ivar commented on July 23, 2024

Don't we already have this in stats for peer connection-related use cases? Also works outside of peer-connection in a pinch.

For playback, frame-rates appear measurable on the video element in Chrome and Firefox (dunno what Safari has here). What other use cases are there?

from mediacapture-extensions.

jan-ivar avatar jan-ivar commented on July 23, 2024

track.framesEmitted: Total counter of frames emitted by the source.

This explanation confused me. In the PR it appears to instead be frames emitted by the track to its consumer, not the total frame count of the (camera) source. Which is it?

from mediacapture-extensions.

henbos avatar henbos commented on July 23, 2024

@jan-ivar "media-source" frame rates need to be clarified... historically they are the standardized version of "googFrameRateInput". In contrast to the send FPS or encoder FPS, this is the "input FPS", i.e. the rate of frames being input to WebRTC. So with zero frame drops within WebRTC, the media-source's FPS was the maximum possible FPS you could achieve as the send FPS. But frame drops happening prior to WebRTC is not visible in getStats().

Frame producer (e.g. Camera) --> Media Source --> Frame consumer
                              |                |
                              |          framesEmitted
                              |
            framesDropped = delta between framesProduced and framesEmitted (not in getStats)

Arguably you could add framesDropped to getStats(), but there are several use cases where we want to know about framesDropped or framesProduced where WebRTC isn't involved. What would be the argument for adding metrics useful outside of WebRTC to WebRTC specific APIs? Why not just add them to the track?

from mediacapture-extensions.

henbos avatar henbos commented on July 23, 2024

track.framesEmitted: Total counter of frames emitted by the source.

This explanation confused me. In the PR it appears to instead be frames emitted by the track to its consumer, not the total frame count of the (camera) source. Which is it?

I was avoiding saying "source FPS" because that begs the question if we're talking about FPS that was produced for the source or FPS emitted from the source (i.e. that was not dropped on the way between producer and source).

There are three interesting frame rates, and none of them are specific to WebRTC:

  • Camera configured FPS: Should be getSettings().frameRate IMO.
  • Camera actual FPS: There is no API for this, but in my proposal this is framesEmitted + framesDropped. Could alternatively be expose as framesProduced.
  • Media source FPS: The frames that have not been dropped on the way to the source, i.e. that consumers could make use of. This is framesEmitted.

from mediacapture-extensions.

henbos avatar henbos commented on July 23, 2024

Changed this to only include framesCaptured

from mediacapture-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.