Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Capture, receive, and RTP timestamp concept definitions & normative requirements for gUM/gDM #156
Capture, receive, and RTP timestamp concept definitions & normative requirements for gUM/gDM #156
Changes from 17 commits
6f40605
ae946a9
2dc8783
41da924
069793f
88a2e13
15e2399
958a9bd
c79520a
4d9e139
584ace5
8d59ae2
f5d3490
d915bd5
a8fc811
b5778b0
012628d
794cd2d
fcafe1c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At TPAC, I think there was consensus on having camera tracks timestamp == capture timestamp.
It does not seem to be the case here though I would guess we keep the idea that the same clock is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry can you elaborate on what you mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per https://jsfiddle.net/4yzmwnsL/, it seems both Chrome and Safari use the same
frame.timestamp
for cloned tracks, even though the second track was cloned 2 seconds after the first one. This seems to be in contradiction with this PR.Instead, implementations seem to be aligned with the idea that
capture timestamp
andpresentation timestamp
are both set by the source, not by the track.I am also not totally clear of the difference between these two timestamps for local sources.
It seems that
the time the frame is appearing on the track
would be thepresentation timestamp
, and would be slightly greater than thecapture timestamp
.If that is the case, we should refer to both
capture timestamp
andpresentation timestamp
in that section of the PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's right, I spoke to this on TPAC. Currently, Chrome emits absolute capture timestamps from gUM/gDM capture to the webcodecs
timestamp
slot in MSTP. We believed we could do this since the nature of the timestamp isn't really well specified in webcodecs. It was later found that there are web apps that depend on a 0-based timeline and we have heuristics to support both cases in MSTG. The purpose of this PR series is to clean this whole topic up and stop using 1 field for 2 things.presentation timestamp
is 0-based and increments by frame duration. We intend to change Chrome back to 0-based here after the PR series is landed.capture timestamp
is absolute & unobservable on MediaStreamTracks but there are behavior requirements stated for gDM/gUM in this PR. It becomes observable first inVideoFrameMetadata
creation at the MSTP.For gUM/gDM sources, assume frame sequence indices 0, 1, 2, i ... N.
presentation timestamp[i + 1] - presentation timestamp[i] = capture timestamp[i + 1] - capture timestamp[i] = VideoFrame.duration[i]
i.e. same clock rate, different origin.Suggestions on how to make this clearer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is fine to me.
This PR assumes that
0
is per track. Meaning that track and track.clone() would not have the same definition of0
. This seems unnatural to me. I would tend to go with0
as the time of the first frame emitted by the source.For VTG,
0
would refer to the time the first video frame is enqueued.For this PR, that would mean changing
which is relative to the first frame appearing on the track.
towhich is relative to the first frame emitted by the track's [[Source]].
Or it could be
0
per track's sink, meaning that MediaStreamTrackProcessor would always provide its first frame to the web app with a timestamp of0
(provided the web app reads the frames quickly enough).Maybe these web apps (and the heuristics you mentioned) could tell us whether
0
should be per track, per track's sink or per track's source.That makes sense to me.
I would add some wording stating that
presentation timestamp
andcapture timestamp
are using the same clock and have a constant offset.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
0
per track source is what makes most sense. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in a8fc811.
The usages we found would work great if MSTP exposes 0-based from creation.
Done in a8fc811.