Skip to content
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

Shaka Offline Download - Text segments are downloaded before audio&video #4878

Closed
ilFuma opened this issue Jan 10, 2023 · 3 comments · Fixed by #7336
Closed

Shaka Offline Download - Text segments are downloaded before audio&video #4878

ilFuma opened this issue Jan 10, 2023 · 3 comments · Fixed by #7336
Assignees
Labels
component: offline The issue involves the offline storage system of Shaka Player priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@ilFuma
Copy link

ilFuma commented Jan 10, 2023

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

What version of Shaka Player are you using?
4.1.2

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

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

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

What browser and OS are you using?
Chrome 108 - Windows 11

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": "https://rng.stage.ott.irdeto.com/licenseServer/widevine/v1/........" }, "clearKeys": {}, "advanced": { "com.widevine.alpha": { "distinctiveIdentifierRequired": false, "persistentStateRequired": false, "videoRobustness": "SW_SECURE_CRYPTO", "audioRobustness": "SW_SECURE_CRYPTO", "sessionType": "", "serverCertificate": {}, "serverCertificateUri": "", "individualizationServer": "" } }, "delayLicenseRequestUntilPlayed": false, "logLicenseExchange": false, "updateExpirationTime": 1, "preferredKeySystems": [], "keySystemsMapping": {} }, "manifest": { "retryParameters": { "maxAttempts": 2, "baseDelay": 1000, "backoffFactor": 2, "fuzzFactor": 0.5, "timeout": 30000, "stallTimeout": 5000, "connectionTimeout": 10000 }, "availabilityWindowOverride": null, "disableAudio": false, "disableVideo": false, "disableText": false, "disableThumbnails": false, "defaultPresentationDelay": 0, "segmentRelativeVttTiming": false, "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:e2719d58-a985-b3c9-781a-b030af78d30e": "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, "defaultAudioCodec": "mp4a.40.2", "defaultVideoCodec": "avc1.42E01E", "ignoreManifestProgramDateTime": false, "mediaPlaylistFullMimeType": "video/mp2t; codecs=\"avc1.42E01E, mp4a.40.2\"" } }, "streaming": { "retryParameters": { "maxAttempts": 2, "baseDelay": 1000, "backoffFactor": 2, "fuzzFactor": 0.5, "timeout": 30000, "stallTimeout": 5000, "connectionTimeout": 10000 }, "rebufferingGoal": 2, "bufferingGoal": 10, "bufferBehind": 30, "ignoreTextStreamFailures": false, "alwaysStreamText": false, "startAtSegmentBoundary": false, "gapDetectionThreshold": 0.1, "durationBackoff": 1, "forceTransmuxTS": false, "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 }, "offline": { "usePersistentLicense": true, "numberOfParallelDownloads": 8 }, "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 } }, "preferredAudioLanguage": "en", "preferredTextLanguage": "", "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?
Download a DASH (Widevine) content with

  • Multiple subtitles languages
  • Multiple audio languages
  • Multiple video resolutions

What did you expect to happen?
Shaka should download video/audio/text segments in parallel (accordingly to the numberOfParallelDownloads parameter) and in sequential order (same as playback).

What actually happened?
Shaka downloads all the Text segments at the beginning, then Video, than Audio.

Since text segments are many and very small, the browser is very slow to retreive them and (based on the actual number of sub languages) it can take up to 5/10 minutes to download just all of them for a standard-duration movie.

I tried increasing the number of parallel downloads, but the performance differences are negligible.

Please not that this behaviour started with the version 4.x, oldest version (I tried with Shaka 3.2) downloads the segments in the expected order and are way more fast to complete a download (same manifest, same pc, same network).

@ilFuma ilFuma added the type: bug Something isn't working correctly label Jan 10, 2023
@github-actions github-actions bot added this to the v4.4 milestone Jan 10, 2023
@avelad avelad added the component: offline The issue involves the offline storage system of Shaka Player label Jan 16, 2023
@theodab
Copy link
Contributor

theodab commented Jan 18, 2023

The download order was changed in preparation for adding support for background fetching in service workers. Background fetch can't fetch text tracks, if I recall, so the download order was changed to download text first. Otherwise text might not be downloaded at all. See #879.

Unfortunately, when I tried to implement the next step, there ended up being severe bugs in Chrome's implementation of that feature that made going forward impossible. They've fixed those bugs since, but in the meantime our priorities have shifted and background fetch is no longer as important to us.

Since we don't have plans to add background fetch anytime soon, I suppose we could partially/fully revert those changes.

Also, so GitHub links these, this is related to #4625

@theodab theodab added type: enhancement New feature or request priority: P1 Big impact or workaround impractical; resolve before feature release and removed type: bug Something isn't working correctly labels Jan 18, 2023
@ilFuma
Copy link
Author

ilFuma commented Jan 18, 2023

This would be great!

BTW, if in the future the "background fetch" will become a priority again, would it be possible to download the text tracks in advance only if the "background fetch" is requested?
(Keeping the mixed -and faster- download mode in case of foreground fetch)

@theodab
Copy link
Contributor

theodab commented Jan 18, 2023

Probably, yeah.
To be honest, when I made that change, I simply hadn't thought of the case of an asset with segmented text. Most of our sample content has all one file per text language, so I hadn't expected the time overhead for the change to be too bad.

@avelad avelad assigned avelad and unassigned avelad Jan 31, 2023
@avelad avelad modified the milestones: v4.4, v4.5 Aug 31, 2023
@avelad avelad modified the milestones: v4.5, v4.6 Oct 5, 2023
@avelad avelad modified the milestones: v4.6, v5.0 Nov 16, 2023
@avelad avelad added the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Dec 4, 2023
@avelad avelad modified the milestones: v4.7, v5.0 Dec 4, 2023
@avelad avelad modified the milestones: v4.8, v4.9 Apr 26, 2024
@avelad avelad modified the milestones: v4.9, v4.10 May 30, 2024
@avelad avelad modified the milestones: v4.10, v4.11 Jul 1, 2024
@avelad avelad modified the milestones: v4.11, v4.12 Sep 12, 2024
@avelad avelad self-assigned this Sep 18, 2024
@avelad avelad removed the flag: seeking PR We are actively seeking PRs for this; we do not currently expect the core team will resolve this label Sep 18, 2024
@avelad avelad added type: bug Something isn't working correctly and removed type: enhancement New feature or request labels Sep 18, 2024
avelad added a commit that referenced this issue Sep 18, 2024
Support for using the old parallel download mechanism is also added.

Fixes: #4878
avelad added a commit that referenced this issue Sep 18, 2024
Support for using the old parallel download mechanism is also added.

Fixes: #4878
avelad added a commit that referenced this issue Sep 18, 2024
Support for using the old parallel download mechanism is also added.

Fixes: #4878
joeyparrish pushed a commit that referenced this issue Sep 18, 2024
Support for using the old parallel download mechanism is also added.

Fixes: #4878
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Nov 17, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: offline The issue involves the offline storage system of Shaka Player priority: P1 Big impact or workaround impractical; resolve before feature release status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants