Contact emails
emi...@chromium.org, nik...@chromium.org
Spec
Media Capture from DOM Elements: HTML Canvas Element Media Capture Extensions
Summary
“Media Capture from DOM Elements” document by W3C defines captureStream() method that allows the capture of the <canvas> element in the form of a MediaStream. We implemented the necessary Blink and Chromium sections that would create this stream by accessing the canvas output according to the given frame rate constraints.
Link to “Intent to Implement” blink-dev discussion
Intent to Implement: Media Capture from Canvas
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Demo link
https://cdn.rawgit.com/uysalere/js-demos/master/intro.html
Debuggability
Interoperability and Compatibility Risk
This feature is defined by the W3C spec and already supported by Mozilla Firefox.
During the capture, we can observe some unintended side effects of our canvas implementation. The common mechanisms that animate the content of a canvas (like requestAnimationFrame and setTimeout) may stop or get throttled down in the cases below.
1) The page with <canvas> is not visible.
2) Canvas created with document.createElement() but never inserted to the DOM.
3) Canvas with "display:none".
4) Canvas in iframes scrolled out of view.
We will continue the discussion the discussion and work on possible solutions if necessary for these cases in the meantime.
OWP launch tracking bug
Entry on the feature dashboard
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
☆PhistucK
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Niklas
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
LGTM1 with commentary:Most of the spec issues still remain open, but for most it's now clear what should happen. Can someone comment on each open issue what behavior Blink will now ship, and that it's expected that the spec will be made to match? Shipping closes the door on certain kinds of changes, and it's just as well to say it explicitly up front.
This makes me a little nervous in the abstract. In general I think our policy is that we only ship features which have been well specified somewhere, and I don't think "open github issues where the conclusion is mostly clear" really counts as "well specified" (assuming developer-impacting spec changes are required based on the conclusion). A pull request with concrete changes may (assuming there are no major outstanding concerns raised with that PR) - chromestatus can always link to the forked version of the spec until the PR is merged. This is to ensure we're only shipping behavior which another browser can reasonably reproduce exactly and developers can reasonably understand the fine details of.
Thanks for all the help and issues pointed out Philip.On Wed, Mar 23, 2016 at 8:41 AM Rick Byers <rby...@chromium.org> wrote:This makes me a little nervous in the abstract. In general I think our policy is that we only ship features which have been well specified somewhere, and I don't think "open github issues where the conclusion is mostly clear" really counts as "well specified" (assuming developer-impacting spec changes are required based on the conclusion). A pull request with concrete changes may (assuming there are no major outstanding concerns raised with that PR) - chromestatus can always link to the forked version of the spec until the PR is merged. This is to ensure we're only shipping behavior which another browser can reasonably reproduce exactly and developers can reasonably understand the fine details of.Thanks for the explanation and reference Rick. I understand your concerns and I'll try to clarify things as much as I can.The issues where verdict is clear and can be closed are: #31, #30, #28, #27 . One issue that is still discussed and philipj@ also pointed out is #29. This is about MediaStreamTrack behavior, holding onto the last frame or not: Firefox does and Chrome doesn't. This discussion actually belongs to Media Capture Main spec, and probably affects other issues as well as this one.Note that the rest of the open github issues of the spec are related to <video> capture. That is behind a seperate flag, and it is not going to be shipped here. This I2S is only about <canvas> capture.
--
I responded on issue 597876 as well. Sorry for the repeated replies.Note that the fix doesn't hold onto last frame in MediaStreamTrack or change state. It propagates RequestRefreshFrame() calls down to the Source when a new Sink is added, and Source decides to send a refresh frame or not. It was a part of the plan on issue 486274 about tab capture. I decided to take the same approach to canvas capture so that it solves interoperability issues with Firefox in those examples and we don't have the side effects(really risky) of holding onto all last frame in the MediaStreamTrack.Regarding spec changes, AFAIK there isn't a clear description of MediaStreamTrack behavior, i.e. holding onto frames(Firefox vs Chrome) or adding sinks on mediacapture-main spec. I think that discussion belongs to a seperate thread.On Tue, Mar 29, 2016 at 2:29 AM Philip Jägenstedt <phi...@opera.com> wrote:Because I've read my inbox in order I've already commented on the review and issue 597876, but maybe this is a better place to discuss this. Is the intention of the fix to behave as if a MediaStreams holds onto the last frame that passes through it, or something else? How would it be expressed in spec terms?On Tue, Mar 29, 2016 at 2:17 AM, 'Emircan Uysaler' via blink-dev <blin...@chromium.org> wrote:Update:After the fix discussed here , the issue in #29 is solved for canvas capture. (Check the demo mentioned) MediaStreamTrack behavior -holding onto the last frame or not- can continue to be discussed, but it no longer affects this feature.As I said, we are aiming for M51, and I am looking forward to your feedbacks or approvals. Thanks.On Thu, Mar 24, 2016 at 12:16 AM Philip Jägenstedt <phi...@opera.com> wrote:On Thu, Mar 24, 2016 at 6:38 AM, Emircan Uysaler <emi...@google.com> wrote:Thanks for all the help and issues pointed out Philip.On Wed, Mar 23, 2016 at 8:41 AM Rick Byers <rby...@chromium.org> wrote:This makes me a little nervous in the abstract. In general I think our policy is that we only ship features which have been well specified somewhere, and I don't think "open github issues where the conclusion is mostly clear" really counts as "well specified" (assuming developer-impacting spec changes are required based on the conclusion). A pull request with concrete changes may (assuming there are no major outstanding concerns raised with that PR) - chromestatus can always link to the forked version of the spec until the PR is merged. This is to ensure we're only shipping behavior which another browser can reasonably reproduce exactly and developers can reasonably understand the fine details of.Thanks for the explanation and reference Rick. I understand your concerns and I'll try to clarify things as much as I can.The issues where verdict is clear and can be closed are: #31, #30, #28, #27 . One issue that is still discussed and philipj@ also pointed out is #29. This is about MediaStreamTrack behavior, holding onto the last frame or not: Firefox does and Chrome doesn't. This discussion actually belongs to Media Capture Main spec, and probably affects other issues as well as this one.Note that the rest of the open github issues of the spec are related to <video> capture. That is behind a seperate flag, and it is not going to be shipped here. This I2S is only about <canvas> capture.Yep, that's a good summary. Issue #29 started out with a rather specific test case, and as I say turned into two different concerns. The HTML integration suggested by junov@ looks about right to me, and crucially it would mean that if one starts canvas capture and pokes at the canvas in the same script execution, the new state of the canvas would reliably be the thing that ends up captured.The main compat risk I think is whether a MediaStream holds on to a frame or not, and I'd still like feedback about how to proceed with that. It could be that it's actually controversial and that Gecko's behavior is very intentional in order to make things more predictable, for example.As for spec maturity, one concern I have is that this can be outside of the control of the implementor.
The implementor and spec editor will not always be the same person or work for the same company, and that's a good thing more often than not. I'm not sure that the editor in this case even knows about this Intent to Ship, so making it explicit on the relevant issues should flush out any concerns if they exist.