shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.06k stars 1.33k forks source link

Decoder error w/ DRM content on Tizen Browser since v3.2.0 #4634

Closed jakubkrolikowski closed 1 year ago

jakubkrolikowski commented 1 year ago

Have you read the FAQ and checked for duplicate open issues? yes

What version of Shaka Player are you using? 3.1.8, 3.3.12, 4.2.0, 4.2.3

Can you reproduce the issue with our latest release version? yes

Can you reproduce the issue with the latest code from main? yes

Are you using the demo app or your own custom app? own custom app

If custom app, can you reproduce the issue using our demo app? no

What browser and OS are you using? Samsung Internet on Tizen 6.0

For embedded devices (smart TVs, etc.), what model and firmware version are you using? Tizen 6.0

What configuration are you using? What is the output of player.getConfiguration()? "manifest": { "application/dash+xml": true, "video/vnd.mpeg.dash.mpd": true, "application/x-mpegurl": true, "application/vnd.apple.mpegurl": true, "application/x-offline-manifest": true, "mpd": true, "m3u8": true, "application/vnd.ms-sstr+xml": false, "ism": false }, "media": { "video/mp4; codecs=\"avc1.42E01E\"": true, "video/mp4": true, "video/mp4; codecs=\"avc3.42E01E\"": true, "video/mp4; codecs=\"hev1.1.6.L93.90\"": true, "video/mp4; codecs=\"hvc1.1.6.L93.90\"": true, "video/mp4; codecs=\"hev1.2.4.L153.B0\"; eotf=\"smpte2084\"": false, "video/mp4; codecs=\"hvc1.2.4.L153.B0\"; eotf=\"smpte2084\"": false, "video/mp4; codecs=\"vp9\"": false, "video/mp4; codecs=\"vp09.00.10.08\"": true, "video/mp4; codecs=\"av01.0.01M.08\"": true, "audio/mp4; codecs=\"mp4a.40.2\"": true, "audio/mp4": true, "audio/mp4; codecs=\"ac-3\"": true, "audio/mp4; codecs=\"ec-3\"": true, "audio/mp4; codecs=\"opus\"": true, "audio/mp4; codecs=\"flac\"": true, "video/webm; codecs=\"vp8\"": true, "video/webm": true, "video/webm; codecs=\"vp9\"": true, "video/webm; codecs=\"vp09.00.10.08\"": true, "audio/webm; codecs=\"vorbis\"": true, "audio/webm": true, "audio/webm; codecs=\"opus\"": true, "video/mp2t; codecs=\"avc1.42E01E\"": false, "video/mp2t": false, "video/mp2t; codecs=\"avc3.42E01E\"": false, "video/mp2t; codecs=\"hvc1.1.6.L93.90\"": false, "video/mp2t; codecs=\"mp4a.40.2\"": false, "video/mp2t; codecs=\"ac-3\"": false, "video/mp2t; codecs=\"ec-3\"": false, "text/vtt": true, "application/mp4; codecs=\"wvtt\"": true, "application/mp4": true, "application/ttml+xml": true, "application/mp4; codecs=\"stpp\"": true }, "drm": { "com.microsoft.playready.recommendation": null, "com.apple.fps.3_0": null, "com.apple.fps.2_0": null, "com.apple.fps.1_0": null, "com.adobe.primetime": null, "org.w3.clearkey": { "persistentState": true }, "com.widevine.alpha": { "persistentState": true }, "com.microsoft.playready": { "persistentState": true }, "com.apple.fps": { "persistentState": true } }, "offline": true, "disableVP9": null, "vp9": false, "isChrome": false, "isChromecastAvailable": false, "isSafari": false, "osName": "Tizen", "browserName": "Samsung Internet for Android" }, { "drm": { "retryParameters": { "maxAttempts": 7, "baseDelay": 1000, "backoffFactor": 2, "fuzzFactor": 0.5, "timeout": 30000, "stallTimeout": 5000, "connectionTimeout": 10000 }, "servers": { "com.widevine.alpha": "https://lic.drmtoday.com/license-proxy-widevine/cenc/?specConform=true" }, "clearKeys": {}, "advanced": { "com.microsoft.playready.recommendation": { "distinctiveIdentifierRequired": false, "persistentStateRequired": false, "videoRobustness": "3000", "audioRobustness": "", "sessionType": "", "serverCertificate": {}, "serverCertificateUri": "", "individualizationServer": "" }, "com.microsoft.playready": { "distinctiveIdentifierRequired": false, "persistentStateRequired": false, "videoRobustness": "2000", "audioRobustness": "", "sessionType": "", "serverCertificate": {}, "serverCertificateUri": "", "individualizationServer": "" } }, "delayLicenseRequestUntilPlayed": false, "logLicenseExchange": false, "updateExpirationTime": 1, "preferredKeySystems": [] }, "manifest": { "retryParameters": { "maxAttempts": 2, "baseDelay": 1000, "backoffFactor": 2, "fuzzFactor": 0.5, "timeout": 30000, "stallTimeout": 5000, "connectionTimeout": 10000 }, "availabilityWindowOverride": NaN, "disableAudio": false, "disableVideo": false, "disableText": false, "disableThumbnails": false, "defaultPresentationDelay": 0, "dash": { "clockSyncUri": "", "ignoreDrmInfo": false, "disableXlinkProcessing": false, "xlinkFailGracefully": false, "ignoreMinBufferTime": false, "autoCorrectDrift": true, "initialSegmentLimit": 1000, "ignoreSuggestedPresentationDelay": false, "ignoreEmptyAdaptationSet": false, "ignoreMaxSegmentDuration": false, "keySystemsByURI": { "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey", "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha", "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready", "urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready", "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime" } }, "hls": { "ignoreTextStreamFailures": false, "ignoreImageStreamFailures": false, "useFullSegmentsForStartTime": false, "defaultAudioCodec": "mp4a.40.2", "defaultVideoCodec": "avc1.42E01E" } }, "streaming": { "retryParameters": { "maxAttempts": 120, "baseDelay": 1000, "backoffFactor": 2, "fuzzFactor": 0.5, "timeout": 20000, "stallTimeout": 7000, "connectionTimeout": 15000 }, "rebufferingGoal": 3, "bufferingGoal": 45, "bufferBehind": 10, "ignoreTextStreamFailures": false, "alwaysStreamText": false, "startAtSegmentBoundary": false, "gapDetectionThreshold": 0.5, "smallGapLimit": 0.5, "jumpLargeGaps": false, "durationBackoff": 1, "forceTransmuxTS": false, "safeSeekOffset": 5, "stallEnabled": true, "stallThreshold": 1, "stallSkip": 0, "useNativeHlsOnSafari": true, "inaccurateManifestTolerance": 2, "lowLatencyMode": false, "autoLowLatencyMode": false, "forceHTTPS": false, "preferNativeHls": false, "updateIntervalSeconds": 1, "dispatchAllEmsgBoxes": false, "observeQualityChanges": false }, "offline": { "usePersistentLicense": true }, "abr": { "enabled": true, "useNetworkInformation": true, "defaultBandwidthEstimate": 10000, "switchInterval": 5, "bandwidthUpgradeTarget": 0.85, "bandwidthDowngradeTarget": 0.95, "restrictions": { "minWidth": 0, "maxWidth": null, "minHeight": 0, "maxHeight": null, "minPixels": 0, "maxPixels": null, "minFrameRate": 0, "maxFrameRate": null, "minBandwidth": 0, "maxBandwidth": null }, "advanced": { "minTotalBytes": 128000, "minBytes": 16000, "fastHalfLife": 2, "slowHalfLife": 5 } }, "preferredAudioLanguage": "hi", "preferredTextLanguage": "pl", "preferredVariantRole": "", "preferredTextRole": "", "preferredAudioChannelCount": 2, "preferredVideoCodecs": [], "preferredAudioCodecs": [], "preferForcedSubs": false, "preferredDecodingAttributes": [], "restrictions": { "minWidth": 0, "maxWidth": null, "minHeight": 0, "maxHeight": null, "minPixels": 0, "maxPixels": null, "minFrameRate": 0, "maxFrameRate": null, "minBandwidth": 0, "maxBandwidth": null }, "playRangeStart": 0, "playRangeEnd": null, "cmcd": { "enabled": false, "sessionId": "", "contentId": "", "useHeaders": false } }]

What did you do?

Some time ago I reported a similar bug: https://github.com/shaka-project/shaka-player/issues/4357#issue-1306169273

All videos I tested that time are playing well in new Shaka Player versions, but I have a few cases where the encrypted video is playing well only in v 3.1.8 on the Samsung Internet browser, Tizen >= 5.0. With higher versions, starting from 4.2.x, error 3016 appears:

 "severity": 2,
  "category": 3,
  "code": 3016,
  "data": [3, undefined, ""],
  "handled": false

It happens just in a few cases, but it's repetitive. Any idea which setting I could try for a workaround?

joeyparrish commented 1 year ago

The v3.1 branch is no longer maintained. (See our maintenance policy.) Please try our v3 LTS branch, v3.3.x. We just released v3.3.12 today. If that is working, you can stick to that version for now. The v3.3.x branch will continue to receive updates until April 30, 2023.

The error you mentioned is a decode error from the platform. If the content is HLS, and the error only occurs in v4+, that could indicate a problem with Tizen 5 support for MediaSource sequence mode. That is currently a requirement for HLS in v4+.

If you'd like us to dig more deeply for you, we would need a content URL (as requested in the issue template, in the section you deleted).

If you'd like to work on this yourself, I suggest you use https://index-dot-shaka-player-demo.appspot.com/ or git bisect on your local clone to determine what version or commit first triggered the bug. That would help us understand the problem and make a fix. You are also welcome to send a PR if you find a solution.

Thanks!

jakubkrolikowski commented 1 year ago

The problem occurs in v3.3.12 as well, unfortunately. The last working version is 3.1.8. 3016 error is from v3.2.0 release.

This is encrypted MPD, h264 video.

I can send you a content URL; this will take some time, cause I need to prepare a special version with no authorization.

FernandoGarciaDiez commented 1 year ago

Hi, just letting you know that we are reproducing this issue as well with all versions above 3.2.0, we also tested 4.3.0 and it was failing too. It's not 100% reproducible in all cases, even playing the same content on the same TV can fail sometimes and succeed others. It also seems to affect more some TV sets than others, if we can find a pattern we will let you know. Thank you!

avelad commented 1 year ago

Please, provide a url a stream to test it.

github-actions[bot] commented 1 year ago

Closing due to inactivity. If this is still an issue for you or if you have further questions, the OP can ask shaka-bot to reopen it by including @shaka-bot reopen in a comment.

FernandoGarciaDiez commented 1 year ago

@shaka-bot reopen

Sorry for the delay, here's a stream where we have reproduced the issue: https://ott.zapitv.com/vod/eds/DLVY1168148499001017/_/dash_vod_enc/DLVY1168148499001017.mpd license: https://wvfp.zapitv.com:8063?deviceId=NmFiODZjMTEtMWI4Yi0zZDgyLThiMTItZTFjNGU5YzEwNzdi Note however that the license will expire soon, so if you need a new one let me know and I'll try to provide a new one asap.

avelad commented 1 year ago

It looks like your URL is not accessible from the US.

We are always open to accepting a PR to fix this.

FernandoGarciaDiez commented 1 year ago

ok, I think I've found the root cause and I'm working on a PR but I still have some issues with unit tests at the moment...

First, @jakubkrolikowski , @avelad or someone else, could you please reopen this issue? or should I open a new one? or we could also continue the discussion in #4503 which I think looks like a duplicate from this one.

I am reproducing the issue with some streams that have 3 variants, 2 of them are supported on these TVs, but the one with higher resolution isn't. This variant uses this video: video/mp4;codecs="avc1.64002a";framerate="25";bitrate="6000000";width="1980";height="1080"

Now, with the current implementation, at filterManifestByMediaCapabilities function from stream_utils.js we are checking Capabilities.isTypeSupported(fullType) , where this "fullType" only includes the mime type and the codecs (video/mp4; codecs="avc1.64002a" for example). This is currently returning true, so the player believes that this variant is supported, but then it fails when it tries to play it.

On the other hand, the old implementation (as pointed by @snazreen at #4503) used shaka.media.MediaSourceEngine.isStreamSupported() function which internally checks Capabilities.isTypeSupported(extendedMimeType), where "extendedMimeType" includes also the width, height, bitrate and framerate (for example, video/mp4;codecs="avc1.64002a";framerate="25";bitrate="6000000";width="1980";height="1080"), which in this specific case returns false because in this case the 1980 width is not supported (it should be 1920), the variant is filtered out, and the playback is started with the other 2 variants.

I'm working on a PR that would basically change isTypeSupported(fullType) by isTypeSupported(extendedMimeType), but I still have to figure out some issues with unit tests, and also I'm not sure how to cover the mutiplexed streams case (the case from the if (video.codecs.includes(',')) at filterManifestByMediaCapabilities), or if it's not necessary to worry about that case.

jakubkrolikowski commented 1 year ago

Wow! Great job! Thanks for your contribution.

On Fri, Feb 3, 2023 at 12:51 PM FernandoGarciaDiez @.***> wrote:

ok, I think I've found the root cause and I'm working on a PR but I still have some issues with unit tests at the moment...

First, @jakubkrolikowski https://github.com/jakubkrolikowski , @avelad https://github.com/avelad or someone else, could you please reopen this issue? or should I open a new one? or we could also continue the discussion in #4503 https://github.com/shaka-project/shaka-player/issues/4503 which I think looks like a duplicate from this one.

I am reproducing the issue with some streams that have 3 variants, 2 of them are supported on these TVs, but the one with higher resolution isn't. This variant uses this video: video/mp4;codecs="avc1.64002a";framerate="25";bitrate="6000000";width=" 1980";height="1080"

Now, with the current implementation, at filterManifestByMediaCapabilities function from stream_utils.js we are checking Capabilities.isTypeSupported(fullType) , where this "fullType" only includes the mime type and the codecs (video/mp4; codecs="avc1.64002a" for example). This is currently returning true, so the player believes that this variant is supported, but then it fails when it tries to play it.

On the other hand, the old implementation (as pointed by @snazreen https://github.com/snazreen at #4503 https://github.com/shaka-project/shaka-player/issues/4503) used shaka.media.MediaSourceEngine.isStreamSupported() function which internally checks Capabilities.isTypeSupported(extendedMimeType), where "extendedMimeType" includes also the width, height, bitrate and framerate (for example, video/mp4;codecs="avc1.64002a";framerate="25";bitrate="6000000";width="1980";height="1080"), which in this specific case returns false because in this case the 1980 width is not supported (it should be 1920), the variant is filtered out, and the playback is started with the other 2 variants.

I'm working on a PR that would basically change isTypeSupported(fullType) by isTypeSupported(extendedMimeType), but I still have to figure out some issues with unit tests, and also I'm not sure how to cover the mutiplexed streams case (the case from the if (video.codecs.includes(',')) at filterManifestByMediaCapabilities), or if it's not necessary to worry about that case.

— Reply to this email directly, view it on GitHub https://github.com/shaka-project/shaka-player/issues/4634#issuecomment-1415762464, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADC3QPWVJS4MZLONMTRSM3LWVTWMHANCNFSM6AAAAAARSODLXA . You are receiving this because you were mentioned.Message ID: @.***>

-- Jakub Królikowski +49 162 6400341