-
Notifications
You must be signed in to change notification settings - Fork 80
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
Specify mixed encrypted/unencrypted content #251
Comments
As the specification currently stands, attaching a
It would be my assumption that unencrypted media can always be played - for example including after Whether a switch between two supported formats that differ in some significant way (container, codec, codec parameters, encryption etc.) is rendered seamlessly is a quality of implementation issue. Discovery of device behavior here would be in scope of MSE, but I don't believe we have that at present. |
Also, see #197. |
This request has been discussed previously. See: "https://www.w3.org/Bugs/Public/show_bug.cgi?id=22135 and I believe https://www.w3.org/Bugs/Public/show_bug.cgi?id=22137 were RESOLVED as WONTFIX in MSE since the underlying request is an HTML5 feature request. I believe https://www.w3.org/Bugs/Public/show_bug.cgi?id=21333 was lumped in the above two other bugs. The HTML5 bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=22785 has NOT yet been processed or resolved. I recommend that proponents of the requirements here approach the new Web Platform WG to escalate the feature request in 22785." |
@mwatson2, we are talking about a scenario in which MediaKeys has been attached specifically before any content is appended and before playback has started. This scenario involves appending an init segment for encrypted content followed some time later by an init segment for unencrypted content. It makes perfect sense for a DASH manifest to contain an encrypted Period with main content, followed by an unencrypted Period containing an ad, followed by another encrypted Period with main content. This is admittedly an intersection of MSE and EME, as the MSE implementation must allow this If this is a quality of implementation issue, it is one that prevents a primary use case for anyone who wants to serve ads without encrypting them first. |
There are several cases where the capabilities of the media element may change as a result of attaching a MediaKeys object or playing content:
However, you are concerned about the case where you attach MediaKeys and then attempt to play clear content that is encoded with one of the codecs in the capabilities of the MediaKeySystemAccess object. There is nothing to say this may fail. I have some sympathy with the idea that otherwise present functionality should not just disappear in unexplained and unspecified ways. There is no procedure for "unencrypted block encountered" which might say that if unencrypted data is not supported at this time you could fail in some way. I would be surprised if this was not supported in existing implementations. We could define a test for this. If we find diversity in what is supported, that would motivate fixing #197 soon so you can find out. |
Unencrypted content is already supported in general, since it is common to have a "clear lead" to give the client time to acquire licenses. In those cases, the unencrypted blocks are part of the same stream as later encrypted blocks, so only one initialization segment is given and it indicates encrypted content. I have seen no interop issues with that. In the OP's scenario, though, there is a second stream which is unencrypted, and therefore a second initialization segment which indicates unencrypted content. We have seen Chrome reject this second init segment after the first one has already been appended. It would appear that the MSE implementation is the one rejecting the init segment. |
In the demuxer, we allow DecryptConfig change upon config change, including but not limited to: - switching between clear and encrypted - encryption scheme change Media Renderer implementation should support such changes. The detailed requirement from the spec's perspective is tracked at: w3c/encrypted-media#251 Currently the default media Renderer (RendererImpl) supports switching from encrypted to clear, because: - Decrypt-and-decode mode: Decrypting{Audio|Video}Decoder supports clear buffer. - Decrypt-only mode: DecryptingDemuxerStream supports clear buffer. However, switching from clear to encrypted is not supported in RendererImpl, because the clear decoder doesn't support decryption. This will be fixed in a later CL. BUG=597443 TEST=Updated pipeline_integration_tests. Review-Url: https://codereview.chromium.org/2543623003 Cr-Commit-Position: refs/heads/master@{#451212}
In the demuxer, we allow DecryptConfig change upon config change, including but not limited to: - switching between clear and encrypted - encryption scheme change Media Renderer implementation should support such changes. The detailed requirement from the spec's perspective is tracked at: w3c/encrypted-media#251 Currently the default media Renderer (RendererImpl) supports switching from encrypted to clear, because: - Decrypt-and-decode mode: Decrypting{Audio|Video}Decoder supports clear buffer. - Decrypt-only mode: DecryptingDemuxerStream supports clear buffer. However, switching from clear to encrypted is not supported in RendererImpl, because the clear decoder doesn't support decryption. This will be fixed in a later CL. BUG=597443 TEST=Updated pipeline_integration_tests. Review-Url: https://codereview.chromium.org/2543623003 Cr-Original-Commit-Position: refs/heads/master@{#451212} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 65c23034a1deaa9b221ef98928925bee36304fd6
FWIW, the proposed spec text is as follows (04eeb40):
Let's resume the discussion and reach a conclusion on this matter. |
Moved out of v2 milestone. This isn't a high enough priority to get finished in time for the next working draft. |
Discussed in Media WG meeting 16 May 2023. General agreement in support of the change proposed in #251 (comment), and will help with interoperability. |
@joeyparrish @gregwfreedman @jernoble Could you please take a look at the suggestion above and share your thoughts? Thanks! |
I don't think allowing using different content types for clear and encrypted content is a good idea, specially if you don't support |
|
No, it is not orthogonal. One thing is mixing encrypted and clear content that are using the same content type and another thing is mixing clear and encrypted content that use different content types. In the former I agree with you, in the latter I definitely thing we should use |
That's not what I meant. What I said was "this issue is about mixing clear and encrypted contents, regardless they have the same content type or not". What you are suggesting here exactly? I feel a bit lost. |
I am referring to this part:
I think we should not "leave to other specifications" if we can or can't use different content types. IMHO, the content type should be the same when switching back and forth from encrypted to unencrypted but if we decide to change the content type, a changeType must be issued (if supported). |
This patch implements a new behavior that is not included in the EME spec yet [1]. It makes sense to treat a media element with media key attached as a sign of encrypted playback. By implementing Custom Ident, we can setup the encryption pipeline correctly even if the clearlead playback starts with unencrypted content and no encryption information in the metadata. [1] w3c/encrypted-media#251 (comment) Differential Revision: https://phabricator.services.mozilla.com/D216740
This patch implements a new behavior that is not included in the EME spec yet [1]. It makes sense to treat a media element with media key attached as a sign of encrypted playback. By implementing Custom Ident, we can setup the encryption pipeline correctly even if the clearlead playback starts with unencrypted content and no encryption information in the metadata. [1] w3c/encrypted-media#251 (comment) Differential Revision: https://phabricator.services.mozilla.com/D216740
This patch implements a new behavior that is not included in the EME spec yet [1]. It makes sense to treat a media element with media key attached as a sign of encrypted playback. By implementing Custom Ident, we can setup the encryption pipeline correctly even if the clearlead playback starts with unencrypted content and no encryption information in the metadata. [1] w3c/encrypted-media#251 (comment) Differential Revision: https://phabricator.services.mozilla.com/D216740
We discussed this issue and the proposal in #251 (comment) at TPAC 2024. There's no objection from the group and both EME editors are in favor of the change. Meeting notes are available at: https://www.w3.org/2024/09/26-mediawg-minutes.html#nt02 Next we need to figure out how to merge this into the EME spec. |
A few comments, having reviewed the proposed text more closely.
|
There should be a way to (1) check if the browser supports and (2) specify that a stream contains a mixture of encrypted and unencrypted content. This is particularly important in the case of dynamic ad insertion, where a manifest/playlist may point to content from an out-of-band ad server that knows nothing of the encryption scheme used for the base content.
It may also be useful to specify that a stream will contain mixed codecs, but I'm not sure if that belongs in the EME.
See: https://bugs.chromium.org/p/chromium/issues/detail?id=597443
The text was updated successfully, but these errors were encountered: