Open youennf opened 1 year ago
These sound fine to me, but @aboba points out that https://wicg.github.io/video-rvfc/ may not meet the registry requirements yet.
I know at TPAC there was some talk of moving rVFC into the HTML spec. Do we still want to do that?
@chrisn @tguilbert-google
I think the idea would be to write a registry entry that would define these values without referencing rvfc. Instead, it would reference webrtc-pc and/or media capture-main.
Yes, I was still planning on moving rVFC to the HTML spec. I haven't found the time to do so yet. Embedding the spec into the HTML spec is more work than just referencing it.
Previous (closed) PR tracking this work: https://github.com/whatwg/html/pull/5332#issuecomment-1251535284
I agree, adding this into HTML makes sense.
The RVFC metadata items seem quite useful to me, but they also raise some questions for the behavior of other APIs:
MediaStreamTrackProcessor
, should we expect capturetime
metadata to be present? Videoframe
metadata items through to encodedChunk metadata? (e.g. capturetime
)encodedChunk
metadata items through to VideoFrame
metadata? (e.g. receivetime
)Without an explicit change to the WebCodecs API, I'm assuming that the answer to questions 2 and 3 is "no". But what I'd really like to be able to do is to trace performance through each stage of the receive and send pipeline.
- In the VideoFrame(s) produced by
MediaStreamTrackProcessor
, should we expectcapturetime
metadata to be present?
It depends on MediaStreamTrack's source. If source is getUserMedia, yes.
2. Is there an expectation that the WebCodecs encoder will carry
Videoframe
metadata items through to encodedChunk metadata? (e.g.capturetime
)
EncodedVideoChunk has no metadata so I would think that it would not be carried automatically.
webrtc encoded transform could decide to expose it in RTCEncodedVideoFrameMetadata
but this is out of scope of web codecs.
3. Is there an expectation that the WebCodecs decoder will carry
encodedChunk
metadata items through toVideoFrame
metadata? (e.g.receivetime
)
My understanding is that the decoder will not have that data so will not set it. The application wrapping the decoder will have this data (say the WebRTC pipeline) and can cheaply attach it to the video frame.
We now have a proposal to add some timing information to the RTCEncodedVideoFrameMetadata
: https://github.com/w3c/webrtc-encoded-transform/pull/173
Would it make sense to define a metadata registry for encodedChunk
and add similar info there?
Is it possible to make progress with this?
Recently, we have received requests from developers asking for this, in particular capture time, to be exposed via MediaStreamTrackProcessor
.
Why can't we use regular VideoFrame.timestamp for capture time when frames are coming from a capture device.
@guidou reached out to me last Friday about surfacing capture timestamps, proposing VideoFrame.timestamp
. My apologies, I didn't follow up after discussing with @Djuffin, and how VideoFrame.timestamp
was a valid path forward.
The MediaStreamTrackProcessor
spec could define how the timestamp
is populated, and might not need a WebCodecs spec change?
We should probably discuss it in the next WG meeting. Extra VideoFrame metadata isn't very useful unless we carry it with video chunks and handle it in encoders and decoders.
Why can't we use regular VideoFrame.timestamp for capture time when frames are coming from a capture device.
We can do that. However, when writing a VideoFrame to a VideoTrackGenerator it is useful to know that the timestamp is a capture timestamp (or alternatively, that the VideoFrame should be treated as a frame coming from a capturer) since the downstream sinks (e.g., a Peer Connection) may treat the frame differently from non-capturer frames. Currently it is not possible to make this distinction, even if the timestamp of capture VideoFrames is the capture timestamp.
Extra VideoFrame metadata isn't very useful unless we carry it with video chunks and handle it in encoders and decoders.
We have use cases for VideoFrame that don't involve encoders or decoders (at least WebCodec ones) that would benefit from this metadata. These use mediacapture-transform.
Seems that when we have metadata on VideoFrame and metadata on RtcEncodedVideoFrame, and we're not looking at an option to make WebCodecs produce/consume RTCEncodedVideoFrame, there's an argument to make that we should be adding metadata to EncodedVideoChunk too, so that it can be carried throughout the ecosystem.
Yes, this was requested in the past, but I don't remember by who or for what. But it would be useful for sure. I think it was someone working in the cinema industry, but I could be completely misremembering.
@alvestrand @padenot Here are the Issues relating to Encoded*Chunk
metadata:
https://github.com/w3c/webcodecs/issues/245
https://github.com/w3c/webcodecs/issues/189
It seems useful to expose some fields in VideoFrameMetadata like:
This could be added as an entry in VideoFrameMetadata registry.