shaka-project / shaka-player

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

Duplicated Subtles on LG TV #6773

Open KemotiaDev opened 3 weeks ago

KemotiaDev commented 3 weeks ago

Have you read the FAQ and checked for duplicate open issues? SImilar issue (closed due to inactivity): https://github.com/shaka-project/shaka-player/issues/6007

If the problem is related to FairPlay, have you read the tutorial?

Related to Widevine and DASH

What version of Shaka Player are you using?

4.6.0 (shaka-player.compiled.min.js)

Can you reproduce the issue with our latest release version? Didn't try. This was reported by customers in prod app

Can you reproduce the issue with the latest code from main? Didn't try. It's hard to reproduce with our LG TV models

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

If custom app, can you reproduce the issue using our demo app? Can't test it

What browser and OS are you using? LG WebOS

For embedded devices (smart TVs, etc.), what model and firmware version are you using? LG TV from 2022 and 2023 Example models: LG 2022: 50QNED816QA LG 2023: 43UR80006LJ

What are the manifest and license server URIs?

What configuration are you using? What is the output of player.getConfiguration()?

{
    "drm": {
        "retryParameters": {
            "maxAttempts": 2,
            "baseDelay": 1000,
            "backoffFactor": 2,
            "fuzzFactor": 0.5,
            "timeout": 30000,
            "stallTimeout": 5000,
            "connectionTimeout": 10000
        },
        "servers": {
            "com.widevine.alpha": **censored**
        },
        "clearKeys": {},
        "advanced": {
            "com.widevine.alpha": {
                "distinctiveIdentifierRequired": false,
                "persistentStateRequired": false,
                "videoRobustness": "SW_SECURE_CRYPTO",
                "audioRobustness": "SW_SECURE_CRYPTO",
                "sessionType": "",
                "serverCertificate": {},
                "serverCertificateUri": "",
                "individualizationServer": ""
            }
        },
        "delayLicenseRequestUntilPlayed": false,
        "persistentSessionOnlinePlayback": false,
        "persistentSessionsMetadata": [],
        "logLicenseExchange": false,
        "updateExpirationTime": 1,
        "preferredKeySystems": [],
        "keySystemsMapping": {},
        "parseInbandPsshEnabled": false,
        "minHdcpVersion": "",
        "ignoreDuplicateInitData": true
    },
    "manifest": {
        "retryParameters": {
            "maxAttempts": 3,
            "baseDelay": 1000,
            "backoffFactor": 2,
            "fuzzFactor": 0.5,
            "timeout": 20000,
            "stallTimeout": 5000,
            "connectionTimeout": 10000
        },
        "availabilityWindowOverride": null,
        "disableAudio": false,
        "disableVideo": false,
        "disableText": false,
        "disableThumbnails": false,
        "defaultPresentationDelay": 0,
        "segmentRelativeVttTiming": false,
        "raiseFatalErrorOnManifestUpdateRequestFailure": false,
        "dash": {
            "clockSyncUri": "",
            "ignoreDrmInfo": false,
            "disableXlinkProcessing": false,
            "xlinkFailGracefully": false,
            "ignoreMinBufferTime": true,
            "autoCorrectDrift": true,
            "initialSegmentLimit": 1000,
            "ignoreSuggestedPresentationDelay": false,
            "ignoreEmptyAdaptationSet": false,
            "ignoreMaxSegmentDuration": false,
            "keySystemsByURI": { **censored** },
            "sequenceMode": false,
            "enableAudioGroups": false
        },
        "hls": {
            "ignoreTextStreamFailures": false,
            "ignoreImageStreamFailures": false,
            "defaultAudioCodec": "mp4a.40.2",
            "defaultVideoCodec": "avc1.42E01E",
            "ignoreManifestProgramDateTime": false,
            "mediaPlaylistFullMimeType": "video/mp2t; codecs=\"avc1.42E01E, mp4a.40.2\"",
            "useSafariBehaviorForLive": true,
            "liveSegmentsDelay": 3,
            "sequenceMode": true,
            "ignoreManifestTimestampsInSegmentsMode": false,
            "disableCodecGuessing": false,
            "allowLowLatencyByteRangeOptimization": true
        },
        "mss": {
            "sequenceMode": false,
            "keySystemsBySystemId": { **censored** },
        }
    },
    "streaming": {
        "retryParameters": {
            "maxAttempts": 7,
            "baseDelay": 500,
            "backoffFactor": 2,
            "fuzzFactor": 0.5,
            "timeout": 12000,
            "stallTimeout": 5000,
            "connectionTimeout": 10000
        },
        "rebufferingGoal": 2,
        "bufferingGoal": 10,
        "bufferBehind": 30,
        "ignoreTextStreamFailures": false,
        "alwaysStreamText": false,
        "startAtSegmentBoundary": false,
        "gapDetectionThreshold": 0.5,
        "gapJumpTimerTime": 0.25,
        "durationBackoff": 1,
        "safeSeekOffset": 5,
        "stallEnabled": true,
        "stallThreshold": 1,
        "stallSkip": 0.1,
        "useNativeHlsOnSafari": true,
        "inaccurateManifestTolerance": 2,
        "lowLatencyMode": false,
        "autoLowLatencyMode": false,
        "forceHTTPS": false,
        "preferNativeHls": false,
        "updateIntervalSeconds": 1,
        "dispatchAllEmsgBoxes": false,
        "observeQualityChanges": false,
        "maxDisabledTime": 30,
        "parsePrftBox": false,
        "segmentPrefetchLimit": 0,
        "liveSync": false,
        "liveSyncMaxLatency": 1,
        "liveSyncPlaybackRate": 1.1,
        "liveSyncMinLatency": 0,
        "liveSyncMinPlaybackRate": 1
    },
    "mediaSource": {
        "codecSwitchingStrategy": "smooth",
        "sourceBufferExtraFeatures": "",
        "forceTransmux": false,
        "insertFakeEncryptionInInit": true
    },
    "offline": {
        "usePersistentLicense": true,
        "numberOfParallelDownloads": 5
    },
    "abr": {
        "enabled": true,
        "useNetworkInformation": true,
        "defaultBandwidthEstimate": 1000000,
        "switchInterval": 8,
        "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
        },
        "restrictToElementSize": false,
        "restrictToScreenSize": false,
        "ignoreDevicePixelRatio": false,
        "clearBufferSwitch": false,
        "safeMarginSwitch": 0
    },
    "autoShowText": 3,
    "preferredAudioLanguage": "",
    "preferredAudioLabel": "",
    "preferredTextLanguage": "",
    "preferredVariantRole": "",
    "preferredTextRole": "",
    "preferredAudioChannelCount": 2,
    "preferredVideoHdrLevel": "AUTO",
    "preferredVideoLayout": "",
    "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
    },
    "lcevc": {
        "enabled": false,
        "dynamicPerformanceScaling": true,
        "logLevel": 0,
        "drawLogo": false
    },
    "ads": {
        "customPlayheadTracker": false
    }
}

Please not that this is not a config from when the bug occured as we struggle to reproduce it as our customers do. This is how we configure it in general.

What did you do?

Just Played the stream with subtitles

What did you expect to happen? Subtitles to appear once

What actually happened?

Subtitles were duplicated. Same output as in this issue: https://github.com/shaka-project/shaka-player/issues/6007 IMG_6369

Subtitles are configured by

drmConfig.textDisplayFactory = () => corePlayer.provideTextDisplayFactory(videoElement, containerElement);
...
corePlayer.configurePlayer(drmConfig);

where

    provideTextDisplayFactory(videoElement: IVideoElement, containerElement: HTMLElement) {
        return new window.shaka.text.UITextDisplayer(videoElement, containerElement);
    }

Are you planning send a PR to fix it? No

avelad commented 3 weeks ago
**What are the manifest and license server URIs?**
<!-- NOTE:
  You can send the URIs to <shaka-player-maintainers@googlegroups.com> instead,
  but please use GitHub and the template for the rest.
  A copy of the manifest text or an attached manifest will **not** be
  enough to reproduce your issue, and we **will** ask you to send a
  URI instead.  You can copy the URI of the demo app to send us the
  exact asset, licence server, and settings you have selected there.
  If you send the URIs to email, the response time and resolution
  will be much higher.
-->
KemotiaDev commented 3 weeks ago

@avelad here it is https://stream-od.akamaized.net/pfr/67171ac3-b78b-47e2-9dcb-8ebbe1e4725e/mp4/67171ac3_b78b_47e2_9dcb_8ebbe1e4725e(1940921_ISMUSP)_v2.ism/67171ac3_b78b_47e2_9dcb_8ebbe1e4725e(1940921_ISMUSP)_v2.mpd

It's a CastLabs DRMed stream

avelad commented 2 weeks ago

The stream is encrypted and has not provided a license server, without that we cannot test it.

avelad commented 3 days ago

In the main branch we have fixed a problem with duplicate subtitles, can you see if it solves your issue? Thanks!