Re: [webrtc-stats] Stats to keep track of sync between audio and video

Current calculation for E2E delay is referenced here:
https://github.com/webrtc/samples/pull/27/files

googCaptureStartNtpTimeMs is related, but is something we might not 
need if we can do this right. Lets see if I can sum up.
----
The googCaptureStartNtpTimeMs is the time that the capture started in 
the js clock. So lets say it is time 1486405000 when the capture 
started. 
googCaptureStartNtpTimeMs = 1486405000

Then 10 seconds go by. So the date.Now() inside the js returns: 
1486415000. (there is also a step where we use a magic constant to 
turn js epoch into webrtc epoch, but I'll ignore that here). 
Then remoteVideo.currentTime is the time of the last played out frame 
in ntp time. So if it took a full second to get there it would be 
displayed as 9000 (since it's ntp time).

So to get e2e time. You take the js now time "1486415000" subtract the
 capture start time "1486405000" then subtract the last playout time 
"9000" to get "1000" or 1 second.

Now to understand the issue with this from a validity perspective (as 
well as the somewhat convoluted approach) imagine that another second 
goes by but nothing is getting played out (maybe the renderer is 
stuck). Then we would have:

You take the js now time "1486416000" subtract the capture start time 
"1486405000" then subtract the last playout time "9000" to get "2000" 
or 2 second so it looks like 2 seconds happened, but the E2E delay is 
still 1sec, it's just adding random time that the current stuff is 
waiting.
----

So what I want is the ability to use the lastPlayoutTimestamp  - 
remoteVideo.currentTime and have it be the E2E delay (without having 
to worry about converting things to and from ntp time in js). This 
requires that both are reported in the same location atomically though
 or else there could be a sequence issue. So either both in getStats 
or both on the object itself (and not sure if there is an analogous 
for audio, but we want one).

Or, if lastPlayoutTimestamp is equivalent to 
remoteVideo.currentTimestamp then I want an additional value reported 
that is the time the video is rendered/audio is played out in ntp 
timestamp so I can do that calculation. Or an E2E delay stat and the 
currentTimestamp which would be equivalent.


-- 
GitHub Notification of comment by icydragons
Please view or discuss this issue at 
https://github.com/w3c/webrtc-stats/issues/158#issuecomment-277777643 
using your GitHub account

Received on Monday, 6 February 2017 18:58:17 UTC