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

RTCCodecStats.clockRate - media sampling rate or the codec clock rate? #785

Closed
hamishwillee opened this issue Mar 1, 2024 · 2 comments
Closed

Comments

@hamishwillee
Copy link

Spec for RTCCodecStats.clockRate says it is the "media sampling rate". However the parameter that is set is defined in RTCRtpCodec.clockRate as The codec clock rate expressed in Hertz, which on MDN is documented as "the rate at which the codec's RTP timestamp advances"

I'm largely ignorant of this, but looking around, it seems that these are different things. So I am wondering if RTCCodecStats.clockRate definition is correct, and is expected.

This is for MDN docs update - https://github.com/mdn/content/pull/32452/files#r1503650664

@vr000m
Copy link
Contributor

vr000m commented Aug 27, 2024

The value should be the same across SDP and RTP -- see IANA entries for different codecs, although webrtc only supports -- H.264, VP8, (also VP9 and AV1), for audio PCM and Opus (some support AMR and G722).

The values will correspond to the IANA https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml

@alvestrand
Copy link
Contributor

The "sampling rate" of 90000 for video was chosen in order to ensure that the common frame rates of 20, 30, 50, 60 and 29.95 fps could all be represented as integers.

"Media sampling rate" is usually the same number for audio, but is an irrelevant concept for video.

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

3 participants