w3c / mediacapture-transform

MediaStreamTrack Insertable Media Processing using Streams
https://w3c.github.io/mediacapture-transform/
Other
44 stars 19 forks source link

What is the timestamp value of the VideoFrame and AudioFrame from a remote webrtc stream track? #87

Open murillo128 opened 1 year ago

murillo128 commented 1 year ago

I have not been able to find if there is any specification about what is the value of the timestamp attribute of an VideoFrame or AudioFrame from a remote MediaStreamTrack recevied by a webrtc peerconnection.

Is is specified anywhere?

alvestrand commented 1 year ago

Interestingly, this has come up in other contexts today. I think we need to find an answer (preferably a consistent one). Have you observed this value in the current state of implementation?

murillo128 commented 1 year ago

It seems that it is using the elapsed time since the first received frame (i.e. relative timestamp since the beginning of the call, starting at 0)

https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/platform/webrtc/convert_to_webrtc_video_frame_buffer.cc;drc=047c7dc4ee1ce908d7fea38ca063fa2f80f92c77;l=347

https://jsfiddle.net/ytqn98eb/