video-dev / hls.js

HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
https://hlsjs.video-dev.org/demo
Other
14.79k stars 2.57k forks source link

MEDIA_ERR_DECODE issue with Mac Chrome for Live Streaming #515

Closed featheast closed 6 years ago

featheast commented 8 years ago

Trying to seek some help in regarding the issues I am currently seeing now while using hls.js for live streaming. The live feed is from a Wowza with 3 qualities. It runs fine on Ubuntu Chrome, but keep getting MEDIA_ERR_DECODE issues with Chrome on Macs. It's pretty random when the issue may occur, and I am calling hls.recoverMediaError(), sometimes the recover works, sometimes it has to recover multiple times to get it back.

From the logs, it appears the issue usually occur after a level switch. The same source works fine with other players, so it's more likely this is caused by ways how we use it.

It will be great i can get some hints to solve this problem. Thanks in advance.

Part of a log is provided below, and I can provide more if needed. log] > Loaded 2291 of level 2 [log] > engine state transition from FRAG_LOADING to PARSING [log] > Demuxing 2291 of [2282 ,2291],level 2 [log] > decrypting by WebCrypto API [log] > parsed audio,PTS:[88.070,92.110],DTS:[88.070/92.110],nb:174 [log] > parsed video,PTS:[88.087,92.120],DTS:[88.086/92.120],nb:120 [log] > engine state transition from PARSING to PARSED [log] > media buffered : [36.054088,92.106734] [log] > engine state transition from PARSED to IDLE [log] > switching to level 1 [log] > (re)loading playlist for level 1 [log] > engine state transition from IDLE to WAITING_LEVEL [log] > engine state transition from WAITING_LEVEL to IDLE [log] > engine state transition from IDLE to WAITING_LEVEL [log] > engine state transition from WAITING_LEVEL to IDLE [log] > engine state transition from IDLE to WAITING_LEVEL [log] > engine state transition from WAITING_LEVEL to IDLE [log] > engine state transition from IDLE to WAITING_LEVEL [log] > engine state transition from WAITING_LEVEL to IDLE [log] > engine state transition from IDLE to WAITING_LEVEL [log] > engine state transition from WAITING_LEVEL to IDLE [log] > engine state transition from IDLE to WAITING_LEVEL [log] > live playlist, reload in 3020 ms [log] > level 1 loaded [2283,2292],duration:40.066 [log] > live playlist sliding:56.054 [log] > Updating mediasource duration to 96.12010000000001 [log] > engine state transition from WAITING_LEVEL to IDLE [log] > Loading key for 2292 of [2283 ,2292],level 1 [log] > engine state transition from IDLE to KEY_LOADING [log] > engine state transition from KEY_LOADING to IDLE [log] > Loading 2292 of [2283 ,2292],level 1, currentTime:69.603026,bufferEnd:92.107 [log] > engine state transition from IDLE to FRAG_LOADING [log] > Loaded 2292 of level 1 [log] > engine state transition from FRAG_LOADING to PARSING [log] > Demuxing 2292 of [2283 ,2292],level 1 [log] > decrypting by WebCrypto API [log] > track:audio,container:audio/mp4,codecs[level/parsed]=[mp4a.40.2/mp4a.40.5] [log] > track:video,container:video/mp4,codecs[level/parsed]=[avc1.4d0020/avc1.4d4020] [log] > parsed audio,PTS:[92.110,96.081],DTS:[92.110/96.081],nb:171 [log] > parsed video,PTS:[92.121,96.120],DTS:[92.121/96.120],nb:120 [log] > engine state transition from PARSING to PARSED [log] > media buffered : [36.054088,96.077414] [log] > engine state transition from PARSED to IDLE log.js:79 VIDEOJS: ERROR: (CODE:3 MEDIA_ERR_DECODE) The media playback was aborted due to a corruption problem or because the media used features your browser did not support. MediaError {code: 3, message: "The media playback was aborted due to a corruption…media used features your browser did not support."}logType @ log.js:79log.error @ log.js:31error @ player.js:2202handleTechError @ player.js:1064ret @ fn.js:35ret @ fn.js:35data.dispatcher @ events.js:72 vjs-hls.js:31 Error Event {isTrusted: true, type: "error", target: video#video-container_html5_api.vjs-tech, currentTarget: video#video-container_html5_api.vjs-tech, eventPhase: 2…}bubbles: falsecancelBubble: falsecancelable: truecurrentTarget: nulldefaultPrevented: falseeventPhase: 0isTrusted: trueisTrusted: truepath: Array[7]returnValue: truesrcElement: video#video-container_html5_api.vjs-techtarget: video#video-container_html5_api.vjs-techaccessKey: ""attributes: NamedNodeMapautoplay: falsebaseURI: "http://localhost/lf404.html"buffered: TimeRangeschildElementCount: 0childNodes: NodeList[0]children: HTMLCollection[0]classList: DOMTokenList[1]className: "vjs-tech"clientHeight: 150clientLeft: 0clientTop: 0clientWidth: 1220contentEditable: "inherit"controls: falsecrossOrigin: nullcurrentSrc: "blob:http%3A//localhost/8ed42edc-8db7-454b-b535-94ba639d6c97"currentTime: 1402.730977dataset: DOMStringMapdefaultMuted: falsedefaultPlaybackRate: 1dir: ""disableRemotePlayback: falsedraggable: falseduration: 1428.8319777777776ended: falseerror: nullfirstChild: nullfirstElementChild: nullheight: 0hidden: falseid: "video-container_html5api"initNetworkState: 0innerHTML: ""innerText: ""isConnected: trueisContentEditable: falselang: ""lastChild: nulllastElementChild: nulllocalName: "video"loop: falsemediaKeys: nullmuted: falsenamespaceURI: "http://www.w3.org/1999/xhtml"networkState: 2nextElementSibling: divnextSibling: divnodeName: "VIDEO"nodeType: 1nodeValue: nulloffsetHeight: 150offsetLeft: 0offsetParent: div#video-container.video-js.vjs-default-skin.vjs-big-play-centered.vjs-live.vjs-has-started.video-container-dimensions.vjs-controls-enabled.vjs-paused.vjs-user-inactiveoffsetTop: 0offsetWidth: 1220onabort: nullonautocomplete: nullonautocompleteerror: nullonbeforecopy: nullonbeforecut: nullonbeforepaste: nullonblur: nulloncancel: nulloncanplay: nulloncanplaythrough: nullonchange: nullonclick: nullonclose: nulloncontextmenu: nulloncopy: nulloncuechange: nulloncut: nullondblclick: nullondrag: nullondragend: nullondragenter: nullondragleave: nullondragover: nullondragstart: nullondrop: nullondurationchange: nullonemptied: nullonencrypted: nullonended: nullonerror: nullonfocus: nulloninput: nulloninvalid: nullonkeydown: nullonkeypress: nullonkeyup: nullonload: nullonloadeddata: nullonloadedmetadata: nullonloadstart: nullonmousedown: nullonmouseenter: nullonmouseleave: nullonmousemove: nullonmouseout: nullonmouseover: nullonmouseup: nullonmousewheel: nullonpaste: nullonpause: nullonplay: nullonplaying: nullonprogress: nullonratechange: nullonreset: nullonresize: nullonscroll: nullonsearch: nullonseeked: nullonseeking: nullonselect: nullonselectstart: nullonshow: nullonstalled: nullonsubmit: nullonsuspend: nullontimeupdate: nullontoggle: nullonvolumechange: nullonwaiting: nullonwebkitfullscreenchange: nullonwebkitfullscreenerror: nullonwheel: nullouterHTML: ""outerText: ""ownerDocument: documentparentElement: div#video-container.video-js.vjs-default-skin.vjs-big-play-centered.vjs-live.vjs-has-started.video-container-dimensions.vjs-controls-enabled.vjs-paused.vjs-user-inactiveparentNode: div#video-container.video-js.vjs-default-skin.vjs-big-play-centered.vjs-live.vjs-has-started.video-container-dimensions.vjs-controls-enabled.vjs-paused.vjs-user-inactivepaused: trueplaybackRate: 1played: TimeRangesplayer: nullplayerId: "video-container"poster: ""prefix: nullpreload: "none"previousElementSibling: nullpreviousSibling: nullreadyState: 4scrollHeight: 150scrollLeft: 0scrollTop: 0scrollWidth: 1220seekable: TimeRangesseeking: falseshadowRoot: nullsinkId: ""spellcheck: truesrc: "blob:http%3A//localhost/8ed42edc-8db7-454b-b535-94ba639d6c97"style: CSSStyleDeclarationtabIndex: -1tagName: "VIDEO"textContent: ""textTracks: TextTrackListtitle: ""translate: truevdata1466491657099: 10videoHeight: 720videoWidth: 1280volume: 1webkitAudioDecodedByteCount: 319725webkitDecodedFrameCount: 875webkitDisplayingFullscreen: falsewebkitDroppedFrameCount: 0webkitSupportsFullscreen: truewebkitVideoDecodedByteCount: 10401133webkitdropzone: ""width: 0proto: HTMLVideoElementtimeStamp: 63135.630000000005type: "error"proto: Event vjs-hls.js:57 Recovery error [log] > recoverMediaError [log] > detachMedia [log] > media source detaching [log] > engine state transition from IDLE to STOPPED [log] > attachMedia [log] > media source opened [log] > startLoad [log] > demuxing in webworker [log] > configure startPosition @72.402753 [log] > resuming video [log] > engine state transition from STOPPED to IDLE [log] > Loading key for 2287 of [2283 ,2292],level 1 [log] > engine state transition from IDLE to KEY_LOADING [log] > engine state transition from KEY_LOADING to IDLE [log] > Loading 2287 of [2283 ,2292],level 1, currentTime:72.402753,bufferEnd:72.403 [log] > engine state transition from IDLE to FRAG_LOADING [log] > Loaded 2287 of level 1 [log] > engine state transition from FRAG_LOADING to PARSING [log] > Demuxing 2287 of [2283 ,2292],level 1 [log] > decrypting by WebCrypto API

mangui commented 8 years ago

when MEDIA_DECODE_ERROR happens at level switch it is usually because of audio change (AAC to HE-AAC, sampling rate change, nb of audio channel change, ...) could you disable the webworker on the demo page and provide debug logs from scratch ? disabling web worker will enable more debug logs on audio codecs

featheast commented 8 years ago

To add a few more info, I did looked at issue #401, and I believe our audio codec are the same across all qualities. Besides, #401 is for Firefox, and our playback on Firefox seems to be fine.

featheast commented 8 years ago

@mangui thanks, let me double confirm that.

rkurbatov commented 8 years ago

Oh, I had the same error today on 0.6.1 running on Mac Chrome, Linux Chrome runs without it. I may provide logs too if needed.

featheast commented 8 years ago

@mangui So I did check out the demo page (http://dailymotion.github.io/hls.js/demo/) and it was running fine from there. Just like @rkurbatov suggested, I found if I revert my version back to 0.5.39 my local testing works fine too, the problem only exists when I am using version 0.6.1. I can't tell what is the version of the demo page is using, but a quick compare of the source it more looks like 0.5.X (not the same as 0.5.39 or 0.5.38 though).

mangui commented 8 years ago

yes demo page is usually matching with the latest diff commited on v0.5.x pages its content is matching with gh-pages branch

drichards commented 8 years ago

Has this issue actually been resolved? It looks like @featheast managed to work around by reverting to 0.5.x, but that means it's still present in 0.6.1

featheast commented 8 years ago

@drichards I don't think the issue is really resolved, for the time being we are happy with the old version, but eventually we gonna have the need to upgrade.

drichards commented 8 years ago

@mangui can we re-open this issue? We're still seeing it as well in 0.6.1 and it sounds like @featheast is as well.

mangui commented 8 years ago

Hi @drichards 0.6.1 is now outdated, I started stabilizing master branch (0.6.x) yesterday, and tagged a new prerelease 0.6.2-1, would you mind rechecking your stream against 0.6.2-1 ? (the demo page is now using it)

if you can still repro, plz also provide the output of chrome://media-internals

drichards commented 8 years ago

Hi @mangui just tried 0.6.2-1 and I'm not seeing the issue anymore there. Thanks!

romsil commented 7 years ago

Is this issue resolved? I am getting MEDIA_ERR_DECODE on our live streams by repeatedly seeking to the end. This is only happening on IE11, but I wonder if, together with #401 , they are of the same issue.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.