Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose SourceBuffer as an ArrayBuffer #209

Open
guest271314 opened this issue Mar 23, 2018 · 4 comments

Comments

@guest271314
Copy link

commented Mar 23, 2018

Currently there does not appear to be any means to get the media accumulated at a SourceBuffer at any time (w3c/html#550, w3c/html#555).

Provide some means of getting the media resource as a file (Blob having MIME type set the the codec set at MediaSource/SourceBuffer; ArrayBuffer) (ideally at any time, before .endOfStream() is called) at least when .endOfStream() is called.

@jyavenard

This comment has been minimized.

Copy link

commented Mar 23, 2018

What meaningful data do you expect to see in return?
That's fine if you've only added the same content.

But if you've added different init segment, overwritten others, added multiple init segments for different resolution/encoding.

What then?

@guest271314

This comment has been minimized.

Copy link
Author

commented Mar 23, 2018

Not having viewed what a SourceBuffer following .endOfStream() looks like, am not sure what to expect.

What am relatively certain of now is that the accumulated data is not retrievable at .srcObject, nor any other way that have tried.

Would naively anticipate that a file having the MIME type equaling the codecs passed to MediaSource and .addSourceBuffer would be either be already assembled or capable of being assembled from the ArrayBuffers passed prior to calling .endOfStream().

The media can be seeked, and has a total duration at a <video> element following .endOfStream() - that accumulated data should be available as a discrete file object (ArrayBuffer; Blob).

The specification states

These URLs are the same as a Blob URI, except that anything in the definition of that feature that refers to File and Blob objects is hereby extended to also apply to MediaSource objects.

though the clear, unambiguous interpretation of that sentence, if accurate, would not have lead to this issue being filed - as a developer cannot request the Blob URL and get the data created by MediaSource object; instead 404 is response or 416 Range Not Satisfiable when trying to use the Blob URL in the same way as a Blob URL with Blob backing.

Is there a reason the SourceBuffer is not exposed?

@guest271314

This comment has been minimized.

Copy link
Author

commented Mar 23, 2018

The reason for this issue is that although have no experience using C++ browsed Chromium source code relevant to MediaSource and cannot locate where the data is stored.

Am trying to find a way to resolve #190 at Chromium, which still crashes the tab when trying to record a <video> element with HTMLMediaElement.captureStream(). Looking into the matter further is what led to w3c/html#550 and w3c/html#555.

The accumulated data is stored somewhere (https://beaufortfrancois.github.io/sandbox/media/source-buffer-limit.html). That data should be exposed to developers.

Am not sure if the original specification anticipated recording a <video> element where MediaSource is set at .src, though Firefox does not have an issue recording the media. If we have access to the accumulated data we might not need to use MediaRecorder at all - the data is already configured to be rendered at a <video> element.

If the decision is made to merge this issue with #190, that is fine.

@guest271314

This comment has been minimized.

Copy link
Author

commented Mar 25, 2018

Is 1.2 Definitions accurate as to the second paragraph below?

MediaSource object URL
A MediaSource object URL is a unique Blob URI [FILE-API] created by createObjectURL(). It is used to attach a MediaSource object to an HTMLMediaElement.

These URLs are the same as a Blob URI [FILE-API], except that anything in the definition of that feature that refers to File and Blob objects is hereby extended to also apply to MediaSource objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.