langhuihui / jessibuca

Jessibuca是一款开源的纯H5直播流播放器
https://jessibuca.com
GNU General Public License v3.0
2.14k stars 401 forks source link

CPU很高,开启MSE后发现视频停止不动 #209

Closed Eric3495 closed 2 years ago

Eric3495 commented 2 years ago

视频是ws-flv h264+G711_a 配置如下: Jessibuca({ container: $container, videoBuffer: 0.2, // 缓存时长 isResize: false, useWCS: false, useMSE: true, debug: true, showBandwidth: false, supportDblclickFullscreen: true, timeout: 10, heartTimeout: 5, heartTimeoutReplay: true, // 自动重连 heartTimeoutReplayTimes: 10, loadingTimeout: 5, loadingTimeoutReplay: true, loadingTimeoutReplayTimes: 10, operateBtns: { fullscreen: false, screenshot: false, play: false, audio: false, recorder: false }, forceNoOffscreen: true, isNotMute: false, hotKey:true, });

一直刷错误; Jessibuca: [player events] mseSourceBufferBusy undefined

bosscheng commented 2 years ago

有测试地址吗,我看下

Eric3495 commented 2 years ago

我目前是在局域网中,外网我看看有没有办法搭建一个。之前测试经常延时很高,后面看后台发现CPU占用比较高,基本都是软解。

bosscheng commented 2 years ago

视频分辨率多少?理论上不应该出现mseSourceBufferBusy 这个说明解码跟不上了。

Eric3495 commented 2 years ago

1080p 4096bps, 理论上应该丢帧快速调到最新的也没问题才是。 我改为D1分辨率测试发现也是不行 看起来是不支持,这个信息MSE是不正常的吗, 我用谷歌

Jessibuca: [Player] use MSE jessibuca.js:309 Jessibuca: [Player options] Object jessibuca.js:309 Jessibuca: [player events] mseSourceOpen undefined jessibuca.js:309 Jessibuca: [decoderWorker] onmessage: init jessibuca.js:309 Jessibuca: [player events] load undefined jessibuca.js:309 Jessibuca: [player] has loaded jessibuca.js:309 Jessibuca: [player events] decoderWorkerInit undefined jessibuca.js:309 Jessibuca: [player events] loading true jessibuca.js:309 Jessibuca: [WebsocketLoader] init jessibuca.js:309 Jessibuca: [common dumex] init Interval jessibuca.js:309 Jessibuca: [FlvDemux] init decoder.js:1 Jessibuca: [worker] init jessibuca.js:309 Jessibuca: [websocketLoader] socket open jessibuca.js:309 Jessibuca: [player events] videoWaiting undefined jessibuca.js:309 Jessibuca: [MediaSource] timeInit set false , cacheTrack = {}

bosscheng commented 2 years ago

你试下useWCS 呢 看看解码能力咋样

Eric3495 commented 2 years ago

Jessibuca: [CanvasVideo] init 6The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. jessibuca.js:1 Jessibuca: [AudioContext] init jessibuca.js:1 Jessibuca: [Recorder] init jessibuca.js:1 Jessibuca: [decoderWorker] init jessibuca.js:1 Jessibuca: [Control] init jessibuca.js:1 Jessibuca: [Player] use offscreen jessibuca.js:1 Jessibuca: [Player options] {videoBuffer: 200, videoBufferDelay: 1000, isResize: false, isFullResize: false, isFlv: false, …} jessibuca.js:1 Jessibuca: [decoderWorker] destroy jessibuca.js:1 Jessibuca: [CanvasVideoLoader] destroy jessibuca.js:1 Jessibuca: [AudioContext] destroy jessibuca.js:1 Jessibuca: [Recorder] destroy jessibuca.js:1 Jessibuca: [control] destroy jessibuca.js:1 Jessibuca: [Events] destroy jessibuca.js:1 Jessibuca: [player events] destroy undefined jessibuca.js:1 Jessibuca: [play] destroy end jessibuca.js:1 Jessibuca: [CanvasVideo] init jessibuca.js:1 Jessibuca: [AudioContext] init jessibuca.js:1 Jessibuca: [Recorder] init jessibuca.js:1 Jessibuca: [decoderWorker] init jessibuca.js:1 Jessibuca: [Control] init jessibuca.js:1 Jessibuca: [Player] use offscreen jessibuca.js:1 Jessibuca: [Player options] {videoBuffer: 200, videoBufferDelay: 1000, isResize: false, isFullResize: false, isFlv: false, …} jessibuca.js:1

   Uncaught (in promise) TypeError: Cannot read properties of null (reading 'transferFromImageBitmap')
at jessibuca.js:1:15683

(匿名) @ jessibuca.js:1 Promise.then(异步) clearView @ jessibuca.js:1 clearView @ jessibuca.js:1 FsH5Play @ fsplayer.js?ver=ver1.1:160 FsChangeStream @ fspreview.js?ver=ver1.1:734 Fs_Load @ fspreview.js?ver=ver1.1:203 window.onload @ fspreview.js?ver=ver1.1:61 load(异步) (匿名) @ fspreview.js?ver=ver1.1:58 jessibuca.js:1 Jessibuca: [decoderWorker] onmessage: init jessibuca.js:1 Jessibuca: [player events] load undefined jessibuca.js:1 Jessibuca: [player] has loaded jessibuca.js:1 Jessibuca: [player events] decoderWorkerInit undefined jessibuca.js:1 Jessibuca: [player events] loading true jessibuca.js:1 Jessibuca: [WebsocketLoader] init jessibuca.js:1 Jessibuca: [common dumex] init Interval jessibuca.js:1 Jessibuca: [FlvDemux] init decoder.js:1 Jessibuca: [worker] init jessibuca.js:1 Jessibuca: [websocketLoader] socket open jessibuca.js:1 Jessibuca: [decoderWorker] onmessage: videoCode 7 decoder.js:1

   Jessibuca: [worker]: [h264 @ 0x61f070] Warning: not compiled with thread support, using thread emulation

printErr @ decoder.js:1 put_char @ decoder.js:1 write @ decoder.js:1 write @ decoder.js:1 doWritev @ decoder.js:1 fd_write @ decoder.js:1 $func2273 @ decoder.wasm:0xaf7a4 $func2312 @ decoder.wasm:0xb205e $func2082 @ decoder.wasm:0xa2c0f $func2080 @ decoder.wasm:0xa24c0 $func2084 @ decoder.wasm:0xa2ca7 $func2083 @ decoder.wasm:0xa2c39 $func1984 @ decoder.wasm:0x9cb8c $func62 @ decoder.wasm:0x33bd $func76 @ decoder.wasm:0x5fbc $func73 @ decoder.wasm:0x5e83 VideoDecoder$decode @ VM14:10 r @ decoder.js:1 (匿名) @ decoder.js:1 setInterval(异步) init @ decoder.js:1 self.onmessage @ decoder.js:1 jessibuca.js:1 Jessibuca: [decoderWorker] onmessage: initVideo width:1920,height:1080 jessibuca.js:1 Jessibuca: [player events] videoInfo {width: 1920, height: 1080, encType: 'H264(AVC)'} jessibuca.js:1 Jessibuca: [canvasVideo] resize jessibuca.js:1 Jessibuca: [player events] start undefined jessibuca.js:1 Jessibuca: [player events] loading false jessibuca.js:1 Jessibuca: [player events] playing true jessibuca.js:1 Jessibuca: [player events] volumechange 0 jessibuca.js:1 Jessibuca: [player events] play undefined jessibuca.js:1 Jessibuca: [player events] playToRenderTimes {playInitStart: 1656473331460, playStart: 1656473331461, streamStart: 1656473331462, streamResponse: 1656473331468, demuxStart: 1656473331485, …} jessibuca.js:1 Jessibuca: [decoderWorker] onmessage: audioCode 7 decoder.js:1

   Jessibuca: [worker]: [pcm_alaw @ 0x663c90] Warning: not compiled with thread support, using thread emulation

printErr @ decoder.js:1 put_char @ decoder.js:1 write @ decoder.js:1 write @ decoder.js:1 doWritev @ decoder.js:1 fd_write @ decoder.js:1 $func2273 @ decoder.wasm:0xaf7a4 $func2312 @ decoder.wasm:0xb205e $func2082 @ decoder.wasm:0xa2c0f $func2080 @ decoder.wasm:0xa24c0 $func2084 @ decoder.wasm:0xa2ca7 $func2083 @ decoder.wasm:0xa2c39 $func1984 @ decoder.wasm:0x9cb8c $func58 @ decoder.wasm:0x2bca $func73 @ decoder.wasm:0x5e83 AudioDecoder$decode @ VM12:10 r @ decoder.js:1 (匿名) @ decoder.js:1 setInterval(异步) init @ decoder.js:1 self.onmessage @ decoder.js:1 jessibuca.js:1 Jessibuca: [decoderWorker] onmessage: initAudio channels:1,sampleRate:48000 jessibuca.js:1 Jessibuca: [player events] audioInfo {encType: 'ALAW', channels: 1, sampleRate: 48000} jessibuca.js:1

   [Deprecation]The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)

initScriptNode @ jessibuca.js:1 decoderWorker.onmessage @ jessibuca.js:1 jessibuca.js:1 Jessibuca: [player events] kBps 881.64 jessibuca.js:1 Jessibuca: [player events] stats {buf: 383, fps: 16, abps: 7062, vbps: 935232, ts: 8466580}

我改了, 网页CPU 25%左右, 视频正常, GPU 占6%CPU和13%的GPU。

bosscheng commented 2 years ago

bosscheng commented 2 years ago

搞分辨率的,条件允许就用webcodecs 吧,