Skip to content

Add rtp timestamp and capture time to RTCEncodedVideoFrameMetadata #137

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ enum RTCEncodedVideoFrameType {

dictionary RTCEncodedVideoFrameMetadata {
long long frameId;
unsigned long rtpTimestamp;
DOMHighResTimeStamp captureTime;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what type and name to use for best consistency. VideoFrame uses the name "timestamp" and the "long long" type, https://w3c.github.io/webcodecs/#dom-videoframe-timestamp. While VideoFrameMetadata use name "captureTime" and type "DOMHighResTimeStamp", see https://wicg.github.io/video-rvfc/#dom-videoframemetadata-capturetime.

Copy link
Collaborator

@fippo fippo Jun 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should have rtpTimestamp and payload type at the root level which frees up names like timestamp for metadata...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't have an informed opinion on naming (and typing). It's not clear to me why we have RTCEncodedVideoFrame.type and .timestamp, and all other metadata in RTCEncodedVideoFrameMetadata.

So I'll adapt to anything the w3c experts say.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what clock is the capture timestamp in? (in particular for remotely-sourced frames or frames from files)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very good question. For consistency, I'd prefer that it's whatever goes in https://w3c.github.io/webcodecs/#dom-videoframe-timestamp on correspponding unencoded frame, but docs aren't crystal clear on what clock that uses. It is marked as "nullable" there, so perhaps it's not provided in all cases?

sequence<long long> dependencies;
unsigned short width;
unsigned short height;
Expand Down