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

Add a section for the background blur field in VideoFrameMetadata #159

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

markafoltz
Copy link

@markafoltz markafoltz commented Nov 12, 2024

Copy link
Author

@markafoltz markafoltz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, a couple of feedbacks on the IDL.

index.html Outdated Show resolved Hide resolved
index.html Outdated
@@ -1876,6 +1876,76 @@ <h3>Examples</h3>
</pre>
</section>
</section>
<section>
<h2>Camera Effect Status</h2>
<p>The {{VideoFrameMetadata}} interface exposes the effect state as a property,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p>The {{VideoFrameMetadata}} interface exposes the effect state as a property,
<p>The {{VideoFrameMetadata}} interface exposes the blur state as a property,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

index.html Outdated
<dl class="dictionary-members" data-link-for="VideoFrameMetadata" data-dfn-for="VideoFrameMetadata">
<dt><dfn><code>background_blur</code></dfn> of type <code>{{BackgroundBlur}}</code></dt>
<dd>
<p>The state of the background blur effect for the current frame.</p>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should explain what it means for the property to be present or missing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

index.html Outdated
<h3>{{BackgroundBlur}}</h3>
<pre class="idl">
dictionary BackgroundBlur {
boolean enabled;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a required property. If background_blur is present, enabled should have a value.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@aboba aboba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the MSTG/VTG issue, looks ok.

index.html Outdated
const videoTrack = stream.getVideoTracks()[0];
const blurIndicator = document.getElementById("blurIndicator");
const trackProcessor = new MediaStreamTrackProcessor({ track: videoTrack });
const trackGenerator = new MediaStreamTrackGenerator({ kind: "video" });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use the standardized API (VideoTrackGenerator)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

index.html Outdated
<section class="notoc">
<h4>Members</h4>
<dl class="dictionary-members" data-link-for="VideoFrameMetadata" data-dfn-for="VideoFrameMetadata">
<dt><dfn><code>background_blur</code></dfn> of type <code>{{BackgroundBlur}}</code></dt>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Properties should be camelCase.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

index.html Outdated
<section>
<h3>Example</h3>
<pre class="example">
// main.js:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this contrasted with code in another .js file or elsewhere?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just leftover from a copy/paste. Removed.

* background_blur -> backgroundBlur
* MediaStreamTrackGenerator -> VideoTrackGenerator
* Removed main.js in code snippet
@brychanrobot
Copy link

Ping on this. I think it's ready for merge as I've addressed all of the comments.

@brychanrobot
Copy link

CC: @guidou, @alvestrand, @jan-ivar, @youennf for review in the next editors meeting.

<dt><dfn><code>backgroundBlur</code></dfn> of type <code>{{BackgroundBlur}}</code></dt>
<dd>
<p>The state of the background blur effect for the current frame. If
the property isn't present, it indicates that the user agent doesn't
Copy link
Member

@jan-ivar jan-ivar Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the property isn't present, it indicates that the user agent doesn't
the property isn't [=map/exist|present=], it indicates that the user agent doesn't

...but see overlapping suggestion below before committing.

Comment on lines +1896 to +1898
<p>The state of the background blur effect for the current frame. If
the property isn't present, it indicates that the user agent doesn't
support reporting blur state.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it supposed to be present on VideoFrames from non-camera sources? The text seems to assume every VideoFrame has a background blur effect state, when AFAIK only cameras have this? Are we to intuit {backgroundBlur: false} in those cases? If so, we might want to clarify that.

What's the precedent here for metadata specific to only certain sources?

I've opened w3c/webcodecs#879, but unless there's a precedent (which I couldn't find), it seems better to me for it to only be present in VideoFrames from cameras. That way false represents a user setting,.

This way, downstream code can differentiate false that from absence (unknown) and make a more informed decision about transmission.

This would have the effect of revealing that the VideoFrame came from a camera, but I can't think of a situation where that would be problematic.

How about:

Suggested change
<p>The state of the background blur effect for the current frame. If
the property isn't present, it indicates that the user agent doesn't
support reporting blur state.
<p>The state of the background blur effect for the current frame, if
[=map/exist|present=]. Absence might indicate that the frame is not
from a camera, or the user agent might not support reporting blur state.

?

I've softened it a bit with "might" since the VideoFrame has a constructor, which means presence and values might have more to do with what metadata was passed in by JS.

Comment on lines +1882 to +1883
which allows apps to know the state for every frame. This is important for
scenarios where the app must ensure user privacy by never sending an
Copy link
Member

@jan-ivar jan-ivar Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid normative "must". I also don't think we want to overstate the security properties of camera background blurring. OS implementations might differ significantly, and they don't necessarily pass everyone's definition of a security measure.

Suggested change
which allows apps to know the state for every frame. This is important for
scenarios where the app must ensure user privacy by never sending an
which allows apps to know the state for every frame. This can be helpful for
scenarios where the app wishes to help protect user privacy by never sending an

<p>The {{VideoFrameMetadata}} interface exposes the blur state as a property,
which allows apps to know the state for every frame. This is important for
scenarios where the app must ensure user privacy by never sending an
un-blurred frame off of the user's device.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mediacapture uses "device" to mean cameras and mics. Maybe:

Suggested change
un-blurred frame off of the user's device.</p>
un-blurred frame off of the user's system.</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants