shaka-project / shaka-player

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

AAC in fMP4 streams fails to be read since 3.2.0 while it worked in 3.1.2 #3691

Closed ThibaultNocchi closed 3 years ago

ThibaultNocchi commented 3 years ago

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

What version of Shaka Player are you using? 3.2.0

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

Can you reproduce the issue with the latest code from master? Yes (I installed master with npm i GITHUB_LINK and loaded the uncompiled JS, is there anything else to try?)

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

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

What browser and OS are you using? Firefox and Chrome, Linux

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

What are the manifest and license server URIs?

This is part of Jellyfin project, and one needs to be authenticated to playback.

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": {},
    "clearKeys": {},
    "advanced": {},
    "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": null,
    "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
    }
  },
  "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,
    "smallGapLimit": 0.5,
    "jumpLargeGaps": false,
    "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
  },
  "offline": {
    "usePersistentLicense": true
  },
  "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
    }
  },
  "preferredAudioLanguage": "",
  "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
}

What did you do?

I try to load a fMP4 file through an HLS manifest with AAC audio.

What did you expect to happen? To work. It also works with MP3 audio, TS container, on iOS. Also, it works as is if I downgrade to 3.1.2, which seems like to be a regression then.

What actually happened?

I get an error 4032 and this console message and nothings starts:

MediaCapabilities.decodingInfo() failed.

{"type":"media-source","audio":{"contentType":"video/mp4; codecs=\"mp4a.40.2\"","channels":2,"bitrate":4276700,"samplerate":1,"spatialRendering":false},"video":{"contentType":"video/mp4; codecs=\"avc1.640029\"","width":1280,"height":720,"bitrate":4276700,"framerate":23.976}}

TypeError: MediaCapabilities.decodingInfo: Invalid AudioConfiguration. probeDecodingInfo_ shaka-player.compiled.debug.js:1925 nextStep_ shaka-player.compiled.debug.js:37 next_ shaka-player.compiled.debug.js:33 next shaka-player.compiled.debug.js:38 asyncExecutePromiseGenerator shaka-player.compiled.debug.js:39 asyncExecutePromiseGenerator shaka-player.compiled.debug.js:39 asyncExecutePromiseGeneratorProgram shaka-player.compiled.debug.js:39 shaka-player.compiled.debug.js:283

Also, usage can be found here https://github.com/jellyfin/jellyfin-vue/blob/a43e19c9331d8587ee0c65051670d06ac9b3bb4e/src/components/Players/ShakaPlayer.vue#L99

theodab commented 3 years ago

That says the contentType for your audio is "video/mp4; codecs="mp4a.40.2".

Is that how it is listed in your manifest? E.g. does the AdaptationSet with contentType="audio" have representations with mimeType="video/mp4"?

The MediaCapabilities browser API, which we started using in v3.2, is expecting "audio/mp4; codecs="mp4a.40.2" instead.

shaka-bot commented 3 years ago

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