-
Notifications
You must be signed in to change notification settings - Fork 115
Section 5.2: centering, scaling, cropping #1283
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
Comments
Related to rtcweb-wg/jsep#828 |
FWIW, in the minutes from TPAC/Lisbon (search for 'crop' on that page) it says we decided on 'center, scale, crop'. That is also con you get to the discussion (and there is also a discussion in the end of #305 that seems to confirm that decision). Slide 73 in https://www.w3.org/2011/04/webrtc/wiki/images/1/1e/WebRTCWG-2016-09-22.pdf |
This algorithm seems bad for a pretty obvious reason: it destroys information and there's no particular reason to think that the center of the image is where the action is. |
Right, e.g. screenshares. As mentioned in rtcweb-wg/jsep#828, I think this text made sense at an earlier point in time, but PeerConnection no longer has any API surface through which cropping can be indicated. So I think this text should probably disappear. |
At the next meeting, if we decide to go with what JSEP says, then this PR looks good to reflect that into the spect. |
I think we reached consensus for this issue, and looks like #1570 addresses it. Are we ready to close this issue? |
When we discussed this at yesterday's interim, it was clear that everyone was not on board, there was not consensus to merge #1570 and we can't close this issue just yet.
|
I have changed my opinion on this. |
@alvestrand the 'constraints' you talk about are the ones imposed by the encoder and decoder (via imageattr, right? (We also have track constraints so I'm a bit confused). |
@stefhak Yes. I looked at #1570 and think the requirement can be made even simpler - I cooked up #1636 to show what I mean. |
@alvestrand I like #1636 - clearer than #1570. |
Harald, when there are no constraints stopping an aspect ratio change, are you ok with changing the aspect ratio?
Sent with my thumbs. Sorry
… On Oct 15, 2017, at 11:15 PM, Harald Alvestrand ***@***.***> wrote:
I have changed my opinion on this.
We should make the spec simpler, not more complex.
The simplest answer, when faced with a situation where you can't rescale the video to fit the constraints, is what JSEP currently says: "NO".
No letterboxing, cropping or pillaring. Either you can scale the video to fit the constraints, or sending the video fails.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@fluffy no, I'm not OK with aspect ratio changes. You agreed in JSEP that aspect ratios should not change; we can't be OK one place and not OK in the other. |
Note: I see no reason not to propose the control and the relaxed MUST NOT requirement as an extension to the spec after CR. If users think it useful and implementors want to implement it, it can be added. |
@alvestrand I'm in agreement with the second part of #1283 (comment) (the one addressed to me). |
@stefhak wrt #1283 (comment) - my interpretation of the constraints text in MediaCapture is that a platform is allowed, but not required, to let getUserMedia() return a scaled and/or cropped version of what the physical camera produces. The spec talks about a range of possible configurations - platforms that do scaling & cropping offer a very large number of configurations; platforms that don't, don't. That's certainly how Chrome's code works (it does scale to fit with specified constraints, and opens the device in a mode that will allow it to satisfy the constraints by croping and/or scaling). |
In response to #1283 (comment): that is sort of what I expected, but that, to me, also indicates that this issue requires more implementation and use experience before resolving. As an example, say dimensions up to X by Y can be transmitted, and webrtc-pc forbids cropping to match imageattr. We could then have the situation that applying height and width constraints to the track to limit it to X by Y gives another result (cropped) than just feeding the unconstrained track to the sender. |
I've opened w3c/mediacapture-main#495 on mediacapture-main, it is related to this discussion. |
From EKR: https://lists.w3.org/Archives/Public/public-webrtc/2017May/0166.html
The advice here (center, scale, then crop) differs from a MUST in JSEP S 3.6.
If the original resolution exceeds the size limits in the attribute,
the sender SHOULD apply downscaling to the output of the
MediaStreamTrack in order to satisfy the limits. Downscaling MUST
NOT change the track aspect ratio.
The text was updated successfully, but these errors were encountered: