-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Trying to run DRM protected stream with AES 128 using hls.js #3052
Comments
Hi @varshney123 The information you provide so far isn't conclusive. There is a difference between DRM and just encrypting a stream (AES-128 being the standard supported way to do that). If you say you do DRM, which type of DRM are you using (Widevine, FairPlay, ... ?) |
Hi,
Thanks for your response.
We use Widevine and Playready with AWSMediaConvert encoder doing the
encryption.
Encryption method is no doubt AES.
So our stream is both AES encrypted and DRM protected.
Can we make it run through hls.js successfully ?
Regards
Aakash Varshney
…On Mon, Oct 12, 2020, 23:08 Stephan Hesse ***@***.***> wrote:
Hi @varshney123 <https://github.com/varshney123>
The information you provide so far isn't conclusive.
There is a difference between DRM and just encrypting a stream (AES-128
being the standard supported way to do that).
If you say you do DRM, which type of DRM are you using (Widevine,
FairPlay, ... ?)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3052 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGG7XWK2URVG5LEH2J2JN7DSKM5J7ANCNFSM4RXKZSJQ>
.
|
Hi Aakash, Yes no doubt DRM implies encryption. But you can have encryption without DRM :) That was what I wanted to gain clarity about. Answers for you:
With any of the two last points, please feel free to contact me directly for any further help or questions. Best, |
HLS.js will support ISO-23001-7, SAMPLE-AES ,SAMPLE-AES-CENC ,SAMPLE-AES-CTR key methods with EME. The AES-128 method is not supported with EME. See #4930 |
Hi, I was integrating hls.js to run DRM protected stream in my player.
When tried with an open stream (not DRM protected)
Stream URL - [https://d6k7l6hrzgp1m.cloudfront.net/convert/streams/HLS/SD/index.m3u8]
Player Successfully played the stream without any issues.
But when used the same stream of same packaging and format but with DRM protection it shows the error
"Buffer add codec error for audio/mpeg;codecs=mp4a.40.2:Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('audio/mpeg;codecs=mp4a.40.2') is unsupported"
I have used the below mentioned configuration to configure hls.js to run DRM protected stream
var config = { "debug": true, emeEnabled: true, requestMediaKeySystemAccessFunc : requestMediaKeySystemAccess, widevineLicenseUrl: "https://hsc.test.ott.irdeto.com/licenseServer/widevine/v1/hsc/license?contentId=DASH_SAMPLE_CONTENT", licenseXhrSetup: function(xhr, url) { xhr.setRequestHeader('Content-Type', 'application/octet-stream'); xhr.setRequestHeader('Authorization', "") } } var hls = new Hls(config);
Please find the below mentioned logs
[log] > attachMedia
hls.js@latest:formatted:106 [log] > media source closed
hls.js@latest:formatted:106 [log] > media source opened
player.html:202 video and hls.js are now bound together !
hls.js@latest:formatted:106 [log] > loadSource:https://d6k7l6hrzgp1m.cloudfront.net/convert/streams/HLS/wv/aes128/index.m3u8
hls.js@latest:formatted:106 [log] > trigger BUFFER_RESET
hls.js@latest:formatted:106 [log] > manifest loaded,1 level(s) found, first bitrate:258310
hls.js@latest:formatted:106 [log] > 1 bufferCodec event(s) expected
hls.js@latest:formatted:106 [log] > startLoad(-1)
hls.js@latest:formatted:106 [log] > switching to level 0
hls.js@latest:formatted:106 [log] > main stream-controller: STOPPED->IDLE
hls.js@latest:formatted:106 [log] > audio tracks updated
hls.js@latest:formatted:106 [log] > Requesting encrypted media key-system access
player.html:182 It is recommended that a robustness level be specified. Not specifying the robustness level could result in unexpected behavior.
player.html:205 manifest loaded, found 1 quality level
hls.js@latest:formatted:106 [log] > subtitle tracks updated
hls.js@latest:formatted:106 [log] > Access for key-system "com.widevine.alpha" obtained
hls.js@latest:formatted:106 [log] > level 0 loaded [1,14],duration:151
hls.js@latest:formatted:106 [log] > Loading key for 1 of [1-14], level 0
hls.js@latest:formatted:106 [log] > main stream-controller: IDLE->KEY_LOADING
hls.js@latest:formatted:106 [log] > main stream-controller: KEY_LOADING->IDLE
hls.js@latest:formatted:106 [log] > Loading 1 of [1-14], level 0, nextLoadPosition: 0, bufferEnd: 0
hls.js@latest:formatted:106 [log] > demuxing in webworker
hls.js@latest:formatted:106 [log] > main stream-controller: IDLE->FRAG_LOADING
hls.js@latest:formatted:106 [log] > Loaded 1 of [1 ,14],level 0
hls.js@latest:formatted:106 [log] > Parsing 1 of [1 ,14],level 0, cc 0
hls.js@latest:formatted:106 [log] > main stream-controller: FRAG_LOADING->PARSING
hls.js@latest:formatted:106 [log] > main:discontinuity detected
hls.js@latest:formatted:106 [log] > main:switch detected
hls.js@latest:formatted:106 [log] > Media-keys created for key-system "com.widevine.alpha"
hls.js@latest:formatted:106 [log] > New key-system session
f9a0b0de-7a1a-4c0f-a787-6ece6157d6e4:1 [log] > WebCrypto AES decrypt
f9a0b0de-7a1a-4c0f-a787-6ece6157d6e4:1 [log] > WebCrypto Error, disable WebCrypto API
f9a0b0de-7a1a-4c0f-a787-6ece6157d6e4:1 [log] > JS AES decrypt
f9a0b0de-7a1a-4c0f-a787-6ece6157d6e4:1 [log] > audio sampling rate : 12000
hls.js@latest:formatted:106 [log] > InitPTS for cc: 0 found from main: 0
hls.js@latest:formatted:106 [log] > creating sourceBuffer(audio/mpeg;codecs=mp4a.40.2)
hls.js@latest:formatted:106 [error] > error while trying to add sourceBuffer:Failed to execute 'addSourceBuffer' on 'MediaSource': The type provided ('audio/mpeg;codecs=mp4a.40.2') is unsupported.
(anonymous) @ hls.js@latest:formatted:106
a.createSourceBuffers @ hls.js@latest:formatted:7519
a.checkPendingTracks @ hls.js@latest:formatted:7463
a.onBufferCodecs @ hls.js@latest:formatted:7491
t.onEventGeneric @ hls.js@latest:formatted:3596
t.onEvent @ hls.js@latest:formatted:3585
d.emit @ hls.js@latest:formatted:877
i.trigger @ hls.js@latest:formatted:5092
h.onFragParsingInitSegment @ hls.js@latest:formatted:6232
t.onEventGeneric @ hls.js@latest:formatted:3596
t.onEvent @ hls.js@latest:formatted:3585
d.emit @ hls.js@latest:formatted:877
i.trigger @ hls.js@latest:formatted:5092
t.onWorkerMessage @ hls.js@latest:formatted:5230
hls.js@latest:formatted:106 [log] > main track:audio,container:audio/mpeg,codecs[level/parsed]=[mp4a.40.2/]
hls.js@latest:formatted:106 [log] > Parsed audio,PTS:[0.000,0.120],DTS:[0.000/0.120],nb:4,dropped:0
hls.js@latest:formatted:106 [log] > main stream-controller: PARSING->PARSED
Update
I have tested the provided unprotected stream https://d6k7l6hrzgp1m.cloudfront.net/convert/streams/HLS/SD/index.m3u8 on Safari Browser MacOs Catalina. It is streaming perfectly creating sourcebuffer with format (audio/mp4;codecs=mp4a.40.2).
But when same format of stream used as widevine DRM protected , its creating sourcebuffer with format (audio/mpeg;codecs=mp4a.40.2)
Also followed this https://github.com/video-dev/hls.js/pull/1190 for the reference but it does not proves that it worked for DRM protected streams.
Need Urgent help. Thanks in advance
The text was updated successfully, but these errors were encountered: