Re: [mediacapture-record] Update https://w3c.github.io/mediacapture-record/#dom-blobeventinit-timecode. (#223)

> From offline discussion with the original spec author it's believed that the initial intent of the spec language was meant to convey that the first produced timecode would contain an absolute timestamp.

@handellm Actually, that makes sense... that way, the user can know when recording started.

We know from MediaRecorder's `start` event *roughly* what browser time the recorder started, but we *don't* know the browser timestamp of the first recorded audio/video data.

So, if a user clicks record and we start recording a MediaStream with a MediaRecorder, with a `timeslice` of `5_000`...

 - `2024-09-05 15:19:32.500Z` We ask MediaRecorder to start
 - `2024-09-05 15:19:33.000Z` MediaRecorder `start` fires
 - `2024-09-05 15:19:33.100Z` The next video frame comes in... this is the first frame since the MediaRecorder has started, and suppose it's a screen recording so frames are random and sparse.
 - ... more frames here ...
 - `2024-09-05 15:19:38.222Z` MediaRecorder `dataavailable` fires.  This is the first chunk.

Now, in this sequence we know when we asked MediaRecorder to start, but this isn't a good timestamp to use for the actual start time because it can take quite a bit of time for MediaRecorder to get moving, especially with hardware codecs involved that need to be woken up and initialized.  MediaRecorder tells us when it starts, but that isn't a good timestamp either because it isn't relative to the MediaStream.  There could be several seconds of nothing before the next frame.  Only when `dataavailable` fires do we know what was captured and when.

I might just be hopeful here, but if the original intent in the spec was to give a timestamp for that first recorded data... maybe we should find a way to make that clearer rather than abandon it?  Or, if this is an expansion of the API and not how browsers work today, then maybe this is worthy of a future addition?

-- 
GitHub Notification of comment by bradisbell
Please view or discuss this issue at https://github.com/w3c/mediacapture-record/pull/223#issuecomment-2332573791 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 5 September 2024 20:27:36 UTC