shaka-project / shaka-player

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

CMCD data is not sent on initial fragmented mp4 requests on dash assets #5094

Closed mpollingerQualabs closed 1 year ago

mpollingerQualabs commented 1 year ago

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

What version of Shaka Player are you using? shaka-player-react: 1.1.5

Can you reproduce the issue with our latest release version? Yes, using latest (at the moment of writing this issue).

Can you reproduce the issue with the latest code from main? Haven't tried. Using directly from npm when doing npm install.

Are you using the demo app or your own custom app? Using own custom application made with react.

If custom app, can you reproduce the issue using our demo app? Haven't tried the shaka demo app.

What browser and OS are you using?

Chrome Version 110.0.5481.177 (Official Build) (64-bit) Ubuntu 22.10

Version 110.0.5481.180 (Official Build) (64-bit) Windows 10 Pro 21H2 64bit

For embedded devices (smart TVs, etc.), what model and firmware version are you using? N/A

What are the manifest and license server URIs?

N/A

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

This is the output:

'{\n "drm": {\n "retryParameters": {\n "maxAttempts": 2,\n "baseDelay": 1000,\n "backoffFactor": 2,\n "fuzzFactor": 0.5,\n "timeout": 30000,\n "stallTimeout": 5000,\n "connectionTimeout": 10000\n },\n "servers": {},\n "clearKeys": {},\n "advanced": {},\n "delayLicenseRequestUntilPlayed": false,\n "logLicenseExchange": false,\n "updateExpirationTime": 1,\n "preferredKeySystems": []\n },\n "manifest": {\n "retryParameters": {\n "maxAttempts": 2,\n "baseDelay": 1000,\n "backoffFactor": 2,\n "fuzzFactor": 0.5,\n "timeout": 30000,\n "stallTimeout": 5000,\n "connectionTimeout": 10000\n },\n "availabilityWindowOverride": null,\n "disableAudio": false,\n "disableVideo": false,\n "disableText": false,\n "disableThumbnails": false,\n "defaultPresentationDelay": 0,\n "dash": {\n "clockSyncUri": "",\n "ignoreDrmInfo": false,\n "disableXlinkProcessing": false,\n "xlinkFailGracefully": false,\n "ignoreMinBufferTime": false,\n "autoCorrectDrift": true,\n "initialSegmentLimit": 1000,\n "ignoreSuggestedPresentationDelay": false,\n "ignoreEmptyAdaptationSet": false,\n "ignoreMaxSegmentDuration": false,\n "keySystemsByURI": {\n "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",\n "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",\n "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",\n "urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95": "com.microsoft.playready",\n "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"\n }\n },\n "hls": {\n "ignoreTextStreamFailures": false,\n "ignoreImageStreamFailures": false,\n "useFullSegmentsForStartTime": false,\n "defaultAudioCodec": "mp4a.40.2",\n "defaultVideoCodec": "avc1.42E01E"\n }\n },\n "streaming": {\n "retryParameters": {\n "maxAttempts": 2,\n "baseDelay": 1000,\n "backoffFactor": 2,\n "fuzzFactor": 0.5,\n "timeout": 30000,\n "stallTimeout": 5000,\n "connectionTimeout": 10000\n },\n "rebufferingGoal": 2,\n "bufferingGoal": 10,\n "bufferBehind": 30,\n "ignoreTextStreamFailures": false,\n "alwaysStreamText": false,\n "startAtSegmentBoundary": false,\n "gapDetectionThreshold": 0.1,\n "smallGapLimit": 0.5,\n "jumpLargeGaps": false,\n "durationBackoff": 1,\n "forceTransmuxTS": false,\n "safeSeekOffset": 5,\n "stallEnabled": true,\n "stallThreshold": 1,\n "stallSkip": 0.1,\n "useNativeHlsOnSafari": true,\n "inaccurateManifestTolerance": 2,\n "lowLatencyMode": false,\n "autoLowLatencyMode": false,\n "forceHTTPS": false,\n "preferNativeHls": false,\n "updateIntervalSeconds": 1,\n "dispatchAllEmsgBoxes": false,\n "observeQualityChanges": false\n },\n "offline": {\n "usePersistentLicense": true\n },\n "abr": {\n "enabled": true,\n "useNetworkInformation": true,\n "defaultBandwidthEstimate": 1000000,\n "switchInterval": 8,\n "bandwidthUpgradeTarget": 0.85,\n "bandwidthDowngradeTarget": 0.95,\n "restrictions": {\n "minWidth": 0,\n "maxWidth": null,\n "minHeight": 0,\n "maxHeight": null,\n "minPixels": 0,\n "maxPixels": null,\n "minFrameRate": 0,\n "maxFrameRate": null,\n "minBandwidth": 0,\n "maxBandwidth": null\n },\n "advanced": {\n "minTotalBytes": 128000,\n "minBytes": 16000,\n "fastHalfLife": 2,\n "slowHalfLife": 5\n }\n },\n "preferredAudioLanguage": "",\n "preferredTextLanguage": "",\n "preferredVariantRole": "",\n "preferredTextRole": "",\n "preferredAudioChannelCount": 2,\n "preferredVideoCodecs": [],\n "preferredAudioCodecs": [],\n "preferForcedSubs": false,\n "preferredDecodingAttributes": [],\n "restrictions": {\n "minWidth": 0,\n "maxWidth": null,\n "minHeight": 0,\n "maxHeight": null,\n "minPixels": 0,\n "maxPixels": null,\n "minFrameRate": 0,\n "maxFrameRate": null,\n "minBandwidth": 0,\n "maxBandwidth": null\n },\n "playRangeStart": 0,\n "playRangeEnd": null,\n "cmcd": {\n "enabled": false,\n "sessionId": "",\n "contentId": "",\n "useHeaders": false\n }\n}'

What did you do?

Using the following asset: https://dash.akamaized.net/dash264/TestCasesHEVC/2a/1/TOS_OnDemand_HEVC_MultiRes.mpd This is a DASH fragmented mp4.

Go into: https://montevideo-tech.github.io/cmcd-validator/

Paste the link and click on Start Shaka image

After the video starts, all the requests made from the player are intercepted and the validator checks for the CMCD data image

In green appear the requests from the player that have correct CMCD data. In red appear the requests from the player that have incorrect CMCD data.

There are some requests that don't have CMCD data. Taking a deeper look at the requests that don't have CMCD data, we noticed that those requests without CMCD data are the ones looking for the byte ranges associated at the indexRange of the SegmentBase that's in the manifest. image image

We found this to be happening only with DASH content that's fragmented mp4.

More samples from the dashif test assets database:

What did you expect to happen? For all the requests to the CDN that come out of the player to have CMCD data, including all audio/video and initial requests for the index range of a fragment.

What actually happened?

When a DASH fragmented mp4 is played the initial request asking for the index range of a fragment does not contain CMCD data in the URL (as queryparams). This causes the (our validator) app to report an error.

This happens for both video and audio track requests.


Additional information

The CMCD validator currently has a bug that doesn't list audio requests. It will get fixed under #112.

The CMCD validator is an open-source project, proposed by Will Law at the Monte<video> Tech meetup and developed by Qualabs (organizer of the meetup). You can find the repository here: https://github.com/montevideo-tech/cmcd-validator/

avelad commented 1 year ago

@littlespex can you review it? Thanks!

littlespex commented 1 year ago

This issue should be addressed by the changes in #5072