Dash-Industry-Forum / dash.js

A reference client implementation for the playback of MPEG DASH via Javascript and compliant browsers.
http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html
Other
5.17k stars 1.68k forks source link

MEDIA_ERR_DECODE (PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding #4631

Open testeur-990 opened 5 days ago

testeur-990 commented 5 days ago

Hello , We observed a MEDIA_ERR_DECODE error (PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding) with some of our live and VOD streams on browsers like Chrome and Edge.

Could you please explain why we are encountering this error?

I also reviewed the Dash.js code related to this type of error and noticed the following logic: if (msg === 'MEDIA_ERR_DECODE' && settings.get().errors.recoverAttempts.mediaErrorDecode >= errorInformation.counts.mediaErrorDecode) { _handleMediaErrorDecode(); return; }

This suggests that there is a mechanism to recover from this type of error (via a seek), correct? If so, why did the recovery mechanism not work in our case?

Thank you

dsilhavy commented 5 days ago

MEDIA_ERR_DECODE is an error thrown by the MSE and forwarded/dispatched by dash.js. This means that some of your media segments are probably corrupt and not decodable by the media pipeline.

As you pointed out, dash.js tries to recover from such errors by putting the corrupt media segments on an ignore list. I don't know why it did not work in your case, did you check the log for this: A MEDIA_ERR_DECODE occured: Resetting the MediaSource. Try to set breakpoints in the dash.js code to check if the StreamController._handleMediaErrorDecode method is called.

testeur-990 commented 5 days ago

Hello @dsilhavy Yes, StreamController._handleMediaErrorDecode is called. See below an excerpt of the logs I have: [17274][BufferController][video] Buffered range: 1732532267.381073 - 1732532273.381073, currentTime = 1732532273.103801 Debug.js:169 [17274][StreamProcessor][video] Appended bytes for video and stream id 0 Debug.js:169 [17275][InsufficientBufferRule] [video] Switch to index 0; buffer is empty. Debug.js:169 [17275][AbrController] [AbrController]: Switching quality in period 0 for media type video. Switch from bitrate 5000 to bitrate 600. Current buffer level: 0.277. Reason:{"message":"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"} Debug.js:169 [17275][StreamProcessor][video] Preparing quality within the same AdaptationSet for type video Debug.js:169 [17279][BufferController][video] Switching to new codec avc1.42e01e without changeType as previous codec avc1.4d4028 is compatible. Debug.js:169 [17281][ScheduleController][video] Quality has changed, get init request for representationid = dzHAJwmf Debug.js:169 [17289][StreamController] A MEDIA_ERR_DECODE occured: Resetting the MediaSource doLog @ Debug.js:169 error @ Debug.js:128 _handleMediaErrorDecode @ StreamController.js:1467 _onPlaybackError @ StreamController.js:1440 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 _onPlaybackError @ PlaybackController.js:756 error addEventListener @ VideoModel.js:385 addAllListeners @ PlaybackController.js:885 _initializeForFirstStream @ PlaybackController.js:130 initialize @ PlaybackController.js:121 _switchStream @ StreamController.js:447 _calculateStartTimeAndSwitchStream @ StreamController.js:405 (anonymous) @ StreamController.js:379 Promise.then _initializeForFirstStream @ StreamController.js:374 (anonymous) @ StreamController.js:264 (anonymous) @ StreamController.js:262 Promise.then _composePeriods @ StreamController.js:261 _onTimeSyncCompleted @ StreamController.js:216 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 _completeTimeSyncSequence @ TimeSyncController.js:560 _onComplete @ TimeSyncController.js:318 (anonymous) @ TimeSyncController.js:249 onload @ TimeSyncController.js:475 load _httpHandler @ TimeSyncController.js:491 _attemptRecursiveSync @ TimeSyncController.js:241 attemptSync @ TimeSyncController.js:166 (anonymous) @ StreamController.js:1288 Promise.then _onManifestUpdated @ StreamController.js:1276 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 update @ ManifestUpdater.js:257 onManifestLoaded @ ManifestUpdater.js:278 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 onXlinkReady @ ManifestLoader.js:89 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 onXlinkAllElementsLoaded @ XlinkController.js:172 resolve @ XlinkController.js:107 onXlinkAllElementsLoaded @ XlinkController.js:168 resolve @ XlinkController.js:107 resolveManifestOnLoad @ XlinkController.js:82 success @ ManifestLoader.js:227 (anonymous) @ HTTPLoader.js:273 Promise.then _onRequestEnd @ HTTPLoader.js:253 _onloadend @ HTTPLoader.js:151 XMLHttpRequest.send load @ XHRLoader.js:82 (anonymous) @ HTTPLoader.js:323 Promise.then (anonymous) @ HTTPLoader.js:314 _loadRequest @ HTTPLoader.js:313 _internalLoad @ HTTPLoader.js:425 load @ HTTPLoader.js:130 load @ URLLoader.js:66 load @ ManifestLoader.js:133 load @ StreamController.js:197 _initializePlayback @ MediaPlayer.js:2722 attachSource @ MediaPlayer.js:2092 $scope.doLoad @ main.js:1153 fn @ VM26:4 b @ angular.min.js:126 e @ angular.min.js:276 $eval @ angular.min.js:145 $apply @ angular.min.js:146 (anonymous) @ angular.min.js:276 dispatch @ jquery-3.1.1.min.js:3 q.handle @ jquery-3.1.1.min.js:3Understand this errorAI Debug.js:169 [17289][FragmentModel][video] abort requests Debug.js:169 [17290][FragmentModel][audio] abort requests Debug.js:169 [17290][StreamController] MediaSource has been resetted. Resuming playback from time 1732532273.103801 Debug.js:169 [17291][StreamController] MediaSource attached to element. Waiting on open... Debug.js:169 [17292][SourceBufferSink][video] Removing sourcebuffer from media source Debug.js:169 [17292][SourceBufferSink][audio] Removing sourcebuffer from media source Debug.js:169 [17293][StreamController] MediaSource is open! Debug.js:169 [17293][MediaSourceController] Set MediaSource duration:Infinity Debug.js:169 [17294][MediaController] Filtering 1 video tracks based on settings Debug.js:169 [17294][MediaController] Filter-Function (matchSettingsViewPoint) resulted in no tracks; setting ignored Debug.js:169 [17294][MediaController] Filtering video tracks ended, found 1 matching track(s). Debug.js:169 [17295][DOMStorage] Last saved bitrate for video was 239082 Debug.js:169 [17301][MediaController] Filtering 1 audio tracks based on settings Debug.js:169 [17302][MediaController] Filter-Function (matchSettingsViewPoint) resulted in no tracks; setting ignored Debug.js:169 [17302][MediaController] Filtering audio tracks ended, found 1 matching track(s). Debug.js:169 [17307][Stream] No text data. Debug.js:169 [17307][Stream] No muxed data. Debug.js:169 [17307][Stream] No image data. Debug.js:169 [17308][PlaybackController] Requesting seek to time: 1732532273.103801 (internal) Debug.js:169 [17312][InsufficientBufferRule] [video] Switch to index 0; buffer is empty. Debug.js:169 [17312][AbrController] [AbrController]: Switching quality in period 0 for media type video. Switch from bitrate 7000 to bitrate 600. Current buffer level: 0.277. Reason:{"message":"[InsufficientBufferRule]: Switching to lowest Representation because buffer is empty"} Debug.js:169 [17312][StreamProcessor][video] Preparing quality within the same AdaptationSet for type video Debug.js:169 [17315][BufferController][video] Switching to new codec avc1.42e01e without changeType as previous codec avc1.4d4028 is compatible. Debug.js:169 [17316][ScheduleController][audio] Quality has changed, get init request for representationid = dyHiAZ8. Debug.js:169 [17318][BufferController][video] Waiting for more buffer before starting playback Debug.js:169 [17318][BufferController][audio] Waiting for more buffer before starting playback Debug.js:169 [17319][ScheduleController][video] Quality has changed, get init request for representationid = dzHAJwmf Debug.js:169 [17337][BufferController][audio] Append Init fragment audio with representationId: dyHiAZ8. and quality: NaN , data size: 620 Debug.js:169 [17337][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 0 and media type audio - Url: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(128000)/Fragments(audio_482_fre=Init)
Debug.js:169 [17338][StreamProcessor][audio] Appended bytes for audio and stream id 0 Debug.js:169 [17338][StreamProcessor][audio] [audio] lastInitializedRepresentationId changed to dyHiAZ8. Debug.js:169 [17338][ScheduleController][audio] Media segment needed for audio and stream id 0 Debug.js:169 [17338][DashHandler][audio] Index for time 1732532273.103801 is 18 Debug.js:169 [17338][StreamProcessor][audio] Next fragment request url for stream id 0 and media type audio is https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(128000)/Fragments(audio_482_fre=83161548833394) with request range undefined Debug.js:169 [17359][BufferController][video] Append Init fragment video with representationId: dzHAJwmf and quality: NaN , data size: 689 Debug.js:169 [17359][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 0 and media type video - Url: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=Init)
Debug.js:169 [17359][StreamProcessor][video] Appended bytes for video and stream id 0 Debug.js:169 [17359][StreamProcessor][video] [video] lastInitializedRepresentationId changed to dzHAJwmf Debug.js:169 [17360][ScheduleController][video] Media segment needed for video and stream id 0 Debug.js:169 [17360][DashHandler][video] Index for time 1732532273.103801 is 18 Debug.js:169 [17360][StreamProcessor][video] Next fragment request url for stream id 0 and media type video is https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=17325322673410724) with request range undefined Debug.js:169 [17361][PlaybackController] Native video element event: loadedmetadata Debug.js:169 [17378][SourceBufferSink][audio] Appending MediaSegment from period 0 to buffer. Request URL: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(128000)/Fragments(audio_482_fre=83161548833394), Representation: ID: dyHiAZ8., bitrate: 128 Debug.js:169 [17379][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 0 and media type audio - Url: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(128000)/Fragments(audio_482_fre=83161548833394)
Debug.js:169 [17381][BufferController][audio] Buffered range: 1732532267.362375 - 1732532273.357041, currentTime = 1732532273.103801 Debug.js:169 [17381][StreamProcessor][audio] Appended bytes for audio and stream id 0 Debug.js:169 [17381][InsufficientBufferRule] [audio] Switch to index 0; buffer is empty. Debug.js:169 [17382][ScheduleController][audio] Media segment needed for audio and stream id 0 Debug.js:169 [17382][StreamProcessor][audio] Next fragment request url for stream id 0 and media type audio is https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(128000)/Fragments(audio_482_fre=83161549121138) with request range undefined Debug.js:169 [17412][ThroughputModel] Added throughput entry for video: 550568 kbit/s Debug.js:169 [17412][SourceBufferSink][video] Appending MediaSegment from period 0 to buffer. Request URL: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=17325322673410724), Representation: ID: dzHAJwmf, bitrate: 600 Debug.js:169 [17413][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 0 and media type video - Url: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=17325322673410724)
Debug.js:169 [17414][BufferController][video] Buffered range: 1732532267.341073 - 1732532273.341073, currentTime = 1732532273.103801 Debug.js:169 [17414][StreamProcessor][video] Appended bytes for video and stream id 0 Debug.js:169 [17414][InsufficientBufferRule] [video] Switch to index 0; buffer is empty. Debug.js:169 [17414][ScheduleController][video] Media segment needed for video and stream id 0 Debug.js:169 [17414][StreamProcessor][video] Next fragment request url for stream id 0 and media type video is https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=17325322733410724) with request range undefined Debug.js:169 [17459][ThroughputModel] video Assuming segment https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=17325322733410724) came from cache, ignoring it for throughput calculation Debug.js:169 [17459][SourceBufferSink][video] Appending MediaSegment from period 0 to buffer. Request URL: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=17325322733410724), Representation: ID: dzHAJwmf, bitrate: 600 Debug.js:169 [17460][StreamProcessor][video] OnFragmentLoadingCompleted for stream id 0 and media type video - Url: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(600000)/Fragments(video=17325322733410724)
Debug.js:169 [17478][ThroughputModel] Added throughput entry for audio: 13988 kbit/s Debug.js:169 [17479][SourceBufferSink][audio] Appending MediaSegment from period 0 to buffer. Request URL: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(128000)/Fragments(audio_482_fre=83161549121138), Representation: ID: dyHiAZ8., bitrate: 128 Debug.js:169 [17479][StreamProcessor][audio] OnFragmentLoadingCompleted for stream id 0 and media type audio - Url: https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/S!dxICVP7...8BFgR4EGYVARgUChsBrw__/QualityLevels(128000)/Fragments(audio_482_fre=83161549121138)
Debug.js:169 [17503][BufferController][audio] Got enough buffer to start Debug.js:169 [17503][BufferController][audio] Buffered range: 1732532267.362375 - 1732532279.351708, currentTime = 1732532273.103801 Debug.js:169 [17503][StreamProcessor][audio] Appended bytes for audio and stream id 0 Debug.js:169 [17505][BufferController][video] Got enough buffer to start Debug.js:169 [17505][ScheduleController][video] Track change rendered for streamId 0 and type video Debug.js:169 [17505][ScheduleController][video] Quality change rendered for streamId 0 and type video Debug.js:169 [17514][ScheduleController][audio] Track change rendered for streamId 0 and type audio Debug.js:169 [17515][ScheduleController][audio] Quality change rendered for streamId 0 and type audio Debug.js:169 [17517][PlaybackController] Native video element event: seeked Debug.js:169 [17518][PlaybackController] Native video element event: loadeddata Debug.js:169 [17518][PlaybackController] Native video element event: play Debug.js:169 [17518][ManifestUpdater] Refresh manifest in 1999 milliseconds. Debug.js:169 [17518][StreamController] [onPlaybackStarted] Debug.js:169 [17519][PlaybackController] Native video element event: playing Debug.js:169 [17538][BufferController][video] Buffered range: 1732532267.341073 - 1732532279.341073, currentTime = 1732532273.119198 Debug.js:169 [17538][StreamProcessor][video] Appended bytes for video and stream id 0 Debug.js:169 [17552][AbrController] [AbrController]: Switching quality in period 0 for media type video. Switch from bitrate 600 to bitrate 5000. Current buffer level: 6.222. Reason:{"drops":4,"noDrops":4,"message":"[SwitchHistoryRule]: Switch to index: 5 samples: 8 drops: 4"} Debug.js:169 [17552][StreamProcessor][video] Preparing quality within the same AdaptationSet for type video Debug.js:169 [17556][BufferController][video] Switching to new codec avc1.4d4028 without changeType as previous codec avc1.42e01e is compatible. Debug.js:169 [17557][FragmentModel][video] abort requests Debug.js:169 [17595][ScheduleController][video] Quality has changed, get init request for representationid = dzFAS0yf Debug.js:169 [17597][StreamController] Video Element Error: MEDIA_ERR_DECODE (PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding: {timestamp=1732532273335708 duration=21333 size=330 is_key_frame=1 encrypted=0}) doLog @ Debug.js:169 fatal @ Debug.js:124 _onPlaybackError @ StreamController.js:1454 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 _onPlaybackError @ PlaybackController.js:756 error addEventListener @ VideoModel.js:385 addAllListeners @ PlaybackController.js:885 _initializeForFirstStream @ PlaybackController.js:130 initialize @ PlaybackController.js:121 _switchStream @ StreamController.js:447 _calculateStartTimeAndSwitchStream @ StreamController.js:405 (anonymous) @ StreamController.js:379 Promise.then _initializeForFirstStream @ StreamController.js:374 (anonymous) @ StreamController.js:264 (anonymous) @ StreamController.js:262 Promise.then _composePeriods @ StreamController.js:261 _onTimeSyncCompleted @ StreamController.js:216 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 _completeTimeSyncSequence @ TimeSyncController.js:560 _onComplete @ TimeSyncController.js:318 (anonymous) @ TimeSyncController.js:249 onload @ TimeSyncController.js:475 load _httpHandler @ TimeSyncController.js:491 _attemptRecursiveSync @ TimeSyncController.js:241 attemptSync @ TimeSyncController.js:166 (anonymous) @ StreamController.js:1288 Promise.then _onManifestUpdated @ StreamController.js:1276 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 update @ ManifestUpdater.js:257 onManifestLoaded @ ManifestUpdater.js:278 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 onXlinkReady @ ManifestLoader.js:89 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 onXlinkAllElementsLoaded @ XlinkController.js:172 resolve @ XlinkController.js:107 onXlinkAllElementsLoaded @ XlinkController.js:168 resolve @ XlinkController.js:107 resolveManifestOnLoad @ XlinkController.js:82 success @ ManifestLoader.js:227 (anonymous) @ HTTPLoader.js:273 Promise.then _onRequestEnd @ HTTPLoader.js:253 _onloadend @ HTTPLoader.js:151 XMLHttpRequest.send load @ XHRLoader.js:82 (anonymous) @ HTTPLoader.js:323 Promise.then (anonymous) @ HTTPLoader.js:314 _loadRequest @ HTTPLoader.js:313 _internalLoad @ HTTPLoader.js:425 load @ HTTPLoader.js:130 load @ URLLoader.js:66 load @ ManifestLoader.js:133 load @ StreamController.js:197 _initializePlayback @ MediaPlayer.js:2722 attachSource @ MediaPlayer.js:2092 $scope.doLoad @ main.js:1153 fn @ VM26:4 b @ angular.min.js:126 e @ angular.min.js:276 $eval @ angular.min.js:145 $apply @ angular.min.js:146 (anonymous) @ angular.min.js:276 dispatch @ jquery-3.1.1.min.js:3 q.handle @ jquery-3.1.1.min.js:3Understand this errorAI Debug.js:169 [17598][StreamController] [object MediaError] doLog @ Debug.js:169 fatal @ Debug.js:124 _onPlaybackError @ StreamController.js:1456 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 _onPlaybackError @ PlaybackController.js:756 error addEventListener @ VideoModel.js:385 addAllListeners @ PlaybackController.js:885 _initializeForFirstStream @ PlaybackController.js:130 initialize @ PlaybackController.js:121 _switchStream @ StreamController.js:447 _calculateStartTimeAndSwitchStream @ StreamController.js:405 (anonymous) @ StreamController.js:379 Promise.then _initializeForFirstStream @ StreamController.js:374 (anonymous) @ StreamController.js:264 (anonymous) @ StreamController.js:262 Promise.then _composePeriods @ StreamController.js:261 _onTimeSyncCompleted @ StreamController.js:216 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 _completeTimeSyncSequence @ TimeSyncController.js:560 _onComplete @ TimeSyncController.js:318 (anonymous) @ TimeSyncController.js:249 onload @ TimeSyncController.js:475 load _httpHandler @ TimeSyncController.js:491 _attemptRecursiveSync @ TimeSyncController.js:241 attemptSync @ TimeSyncController.js:166 (anonymous) @ StreamController.js:1288 Promise.then _onManifestUpdated @ StreamController.js:1276 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 update @ ManifestUpdater.js:257 onManifestLoaded @ ManifestUpdater.js:278 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 onXlinkReady @ ManifestLoader.js:89 (anonymous) @ EventBus.js:145 trigger @ EventBus.js:144 onXlinkAllElementsLoaded @ XlinkController.js:172 resolve @ XlinkController.js:107 onXlinkAllElementsLoaded @ XlinkController.js:168 resolve @ XlinkController.js:107 resolveManifestOnLoad @ XlinkController.js:82 success @ ManifestLoader.js:227 (anonymous) @ HTTPLoader.js:273 Promise.then _onRequestEnd @ HTTPLoader.js:253 _onloadend @ HTTPLoader.js:151 XMLHttpRequest.send load @ XHRLoader.js:82 (anonymous) @ HTTPLoader.js:323 Promise.then (anonymous) @ HTTPLoader.js:314 _loadRequest @ HTTPLoader.js:313 _internalLoad @ HTTPLoader.js:425 load @ HTTPLoader.js:130 load @ URLLoader.js:66 load @ ManifestLoader.js:133 load @ StreamController.js:197 _initializePlayback @ MediaPlayer.js:2722 attachSource @ MediaPlayer.js:2092 $scope.doLoad @ main.js:1153 fn @ VM26:4 b @ angular.min.js:126 e @ angular.min.js:276 $eval @ angular.min.js:145 $apply @ angular.min.js:146 (anonymous) @ angular.min.js:276 dispatch @ jquery-3.1.1.min.js:3 q.handle @ jquery-3.1.1.min.js:3Understand this errorAI main.js:360 {error: DashJSError, type: 'error'} Debug.js:169 [17606][FragmentModel][video] abort requests Debug.js:169 [17606][FragmentModel][audio] abort requests

dsilhavy commented 5 days ago

Ok, then the workaround seems to be applied correctly. However, this only fixes the problem if the other media segments can be decoded and are not corrupt. dash.js will try five times by default and then stop.

          recoverAttempts: {
                mediaErrorDecode: 5
            }
testeur-990 commented 5 days ago

Hello @dsilhavy , We tried to increase the mediaErrorDecode value, but we are still encountering the media decode error. Could you please tell us how to verify that the other media segments can be decoded and are not corrupt? Thank you .

dsilhavy commented 4 days ago

Hello @dsilhavy , We tried to increase the mediaErrorDecode value, but we are still encountering the media decode error. Could you please tell us how to verify that the other media segments can be decoded and are not corrupt? Thank you .

Debugging broken segments is not straight forward, some suggestions

testeur-990 commented 3 days ago

Hello @dsilhavy , When we analyzed the logs and the function, we observed that during the 5 retries, the player repeatedly attempts to seek to the same chunk. We did not observe any logic in the code where it tries to seek to the next segment. Could you please check that? logs : [77420473][StreamController] MediaSource has been resetted. Resuming playback from time 1732708937.125384 Debug.js:169 [77422332][StreamController] MediaSource has been resetted. Resuming playback from time 1732708937.334952 Debug.js:169 [77423541][StreamController] MediaSource has been resetted. Resuming playback from time 1732708937.350519 Debug.js:169 [77424790][StreamController] MediaSource has been resetted. Resuming playback from time 1732708937.369878 Debug.js:169 [77425850][StreamController] MediaSource has been resetted. Resuming playback from time 1732708937.370573

function: ` function _handleMediaErrorDecode() { logger.error('A MEDIA_ERR_DECODE occured: Resetting the MediaSource'); const seekTime = playbackController.getTime(); // Deactivate the current stream. activeStream.deactivate(false);

    // Reset MSE
    logger.info(`MediaSource has been resetted. Resuming playback from time ${seekTime}`);
    _openMediaSource({ seekTime, keepBuffers: false, streamActivated: false });
}`

Thank you

dsilhavy commented 3 days ago

@testeur-990 The problematic segment is put into an ignorelist. Check for:

logger.warn(`Blacklisting segment with url ${blacklistUrl}`);

and

logger.warn(`Fragment request url ${request.url} for stream id ${streamInfo.id} and media type ${type} is on the ignore list and will be skipped`);

Also check the network tab which requests dash.js is making.

testeur-990 commented 3 days ago

@dsilhavy We checked, but we did not find the mentioned logs, could check please ? logs_media_decode_err.log

dsilhavy commented 3 days ago

@testeur-990 Then the error is probably not dispatched by the SourceBuffer and the error handlers are not triggered. I will need your stream to reproduce this issue. Can you host it and provide the URL to me? Also, which platform are you testing on?

testeur-990 commented 2 days ago

Hello @dsilhavy , Sorry for the delayed response. I had to discuss with my team about the stream we can share since it is not a test stream. Could you please use one of these streams
https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm212/index.mpd/Manifest?start=LIVE&end=END&device=DASH_OBE_HD
OR https://group1.tvcdn.orange.be/live/1/1617752113/2ba9132504608ac76314c4f6ba939fad28c87b56de52f3e6189f582c748f0599/sdash/LIVE$obedrm205/index.mpd/Manifest?start=LIVE&end=END&device=DASH_OBE_HD ? Usually, you can reproduce the issue easily on Chrome or Edge, but sometimes you might need to play the stream for a while.

Additionally, could you please share your findings as soon as possible? This issue is blocking us, as we have encountered this error with multiple streams

Thank you

dsilhavy commented 2 days ago

@testeur-990 The problem is that the decode errors are not thrown by the source buffers but only by the video element. As a consequence, the ignorelist mechanism is not triggered and we don't know which segment actually caused the decode error. We would need to put both video and audio segments on the ignore list. This is not implemented yet.

In any case, even the dash.js recovery mechanism won't help much in this case because there seem to be corrupted segments every few seconds. dash.js could recover shortly and then fail again. You see the same decoding error in Shaka Player, so this is definitely a content problem.

Shaka:

Bildschirmfoto 2024-11-28 um 10 26 55

dash.js

Bildschirmfoto 2024-11-28 um 10 27 20