Closed Bug 956997 Opened 10 years ago Closed 10 years ago

Media Recording - Pass timeslices value from recorder to encoder writer

Categories

(Core :: Audio/Video: Recording, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: rlin, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 1 obsolete file)

We have fragment mp4 muxer implementation and we can sync the fragment duration as same as timeslices value from start method.
Summary: Media Recording - Pass timeslices to muxer → Media Recording - Pass timeslices value from recorder to encoder writer
Assignee: nobody → rlin
No longer blocks: 891705
Hi Alfredo, 
Please help this, thanks.
Assignee: rlin → ayang
Hi Chris,

From spec [2], 'timeslice' is 'the number of milliseconds of data to return in a single Blob.'
But current implementation in [1] returns the blob for every 'timeslice' milliseconds. If my understanding is correct, it should be muxer, not MediaRecorder to decide 'timeslice' of blob because only muxer knows the time length of blob, is that correct?

[1] http://dxr.mozilla.org/mozilla-central/source/content/media/MediaRecorder.cpp#286
[2] https://dvcs.w3.org/hg/dap/raw-file/tip/media-stream-capture/MediaRecorder.html
Flags: needinfo?(cpearce)
I don't know the MediaRecorder API very well, so just looking at it now here's my guess:

I think mTimeSlice is being used wrong in MediaRecoder::Session. I think mTimeSlice should be the duration of a blob produced by the muxer, not the time duration in between a dataavailable event being dispatched.

if ((TimeStamp::Now() - mLastBlobTimeStamp).ToMilliseconds() > mTimeSlice) is true, that does not mean that mTimeSlice milliseconds of data has been appended to the encoded buffer cache, right? Data could be late.

It seems to me that mTimeSlice should be being passed to the muxer, and it should be using that as its fragment duration if possible, and once you have a full fragment you should then be dispatching it to JavaScript.

I don't know this code very well, I may be wrong, but that's my interpretation.
Flags: needinfo?(cpearce)
Ya, I also think the time-slice should be duration of the blob, not the blob push out interval.
My implementation just consider the realtime case, so it should be a problem if we allow to record a offline media stream).
Component: Video/Audio → Video/Audio: Recording
Attached patch media_recorder_timeslice (obsolete) — Splinter Review
wip for MediaRecorder and ISOMediaWriter.
Blocks: 984247
Remove the mechanism for counting the timeslice by current time in MediaRecorder::Session so the blob duration is decided by encoder or muxer.
Attachment #8391107 - Attachment is obsolete: true
Attachment #8392757 - Flags: feedback?(roc)
I actually think this doesn't matter much and that the current code is fine. There was never supposed to be a hard guarantee that the data in the blob will have the requested duration. Using the timer should work fine for the use-cases I can think of. Does setting the fragment duration in the ISOMediaWriter actually provide any benefits to the author?
I can't think any benefit to JS author in this case. I'll keep the original implementation.
Thanks for feedback.
Attachment #8392757 - Flags: feedback?(roc)
Assignee: ayang → nobody
Refer to comment 8, We don't need to implement this function at this time. Close this bug at this time.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
No longer blocks: 962878
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: