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 WebRTC-specific interactions with capture/receive/RTP timestamps #224

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// Add additional editors here.
// https://github.com/w3c/respec/wiki/editors
],
"xref": ["webrtc", "hr-time", "mediacapture-streams", "webrtc-stats"],
"xref": ["webrtc", "hr-time", "mediacapture-streams", "webrtc-stats", "mediacapture-extensions"],
"shortName": "webrtc-extensions",
"specStatus": "ED",
"subjectPrefix": "[webrtc-extensions]"
Expand Down Expand Up @@ -920,6 +920,42 @@ <h3>
</div>
</dd>
</dl>
</section>
</section>
<section class="informative">
<h2>Timestamp behavior</h2>
<h2>RTCRtpSender timestamp effects on packet NTP and RTP timestamps</h2>
<p>
The user agent defines a <dfn class="export">frame timestamp</dfn> being the same as the [= capture timestamp =] of the frame being sent on the {{RTCRtpSender}} {{MediaStreamTrack}} if it is set.
If it is unset the user agent estimates a timestamp from the sent frame's [= presentation timestamp =] together with the
time it was received by the {{RTCRtpSender}}.
</p>
<p>
The NTP and RTP timestamps of the encoded frame corresponding to the frame being sent on the {{RTCRtpSender}} {{MediaStreamTrack}} are sourced from the [= frame timestamp =].
</p>

<h2>RTCRtpReceiver timestamps</h2>
<h3>Remote capture timestamp</h3>
<p>
<!-- TODO: How this is estimated is under specified and should be fixed, but the section holds the requestVideoFrameCallback text for now -->
For a frame produced in a {{RTCRtpReceiver}} track, the user agent computes a
<dfn class="export">remote capture timestamp</dfn>. It is a best-effort estimate of the local capture
time on the sender translated to the receiver clock, and can use methods like using RTCP SR
as specified in [[?RFC3550]] Section 6.4.1, or by other alternative means if use by RTCP SR
isn't feasible.
</p><p>
Each frame's [= capture timestamp =] is set to the [= remote capture timestamp =], if available.
</p>
<h3>Received RTP timestamp</h3>
<p>
For a frame produced in a {{RTCRtpReceiver}} track, the frame's [=RTP timestamp=] is set
from the RTP timestamp of constituent packets of the corresponding received encoded frame.
</p>
<h3>Receive timestamp</h3>
<p>
For a frame produced in a {{RTCRtpReceiver}} track, the [=receive timestamp=] is set
as the time the corresponding encoded frame was received by the platform, i.e. the time at which the
last packet belonging to this frame was received over the network.
</p>
</section>
</body>
</html>