goldvideo / h265player

一套完整的Web版H.265播放器解决方案,非常适合学习交流和实际应用。基于JS码流解封装、WebAssembly(FFmpeg)视频解码,利用Canvas画布投影、AudioContext播放音频。
https://goldvideo.github.io/h265player/
1.53k stars 298 forks source link

播放一个大的流,时间久了会有内存溢出问题。这个要去修改decode_wasm 吗? #47

Closed fzw2408 closed 3 years ago

fzw2408 commented 3 years ago

1.浏览器内存好像没有释放。时间久了会提示out of memory

  1. 编译decode_wasm的emsdk 版本1.38.45 .希望这个在decode_wasm编译wiki里注明一下, 其他太新的版本编译可以通过,使用的时候有问题,加载不了。
fzw2408 commented 3 years ago

image

jarry commented 3 years ago

嗯好的。谢谢。有没有兴趣一起来维护

其他

1.浏览器内存好像没有释放。时间久了会提示out of memory

  1. 编译decode_wasm的emsdk 版本1.38.45 .希望这个在decode_wasm编译wiki里注明一下, 其他太新的版本编译可以通过,使用的时候有问题,加载不了。

嗯好的。谢谢。有没有兴趣一起来维护

snxly commented 3 years ago

1.浏览器内存好像没有释放。时间久了会提示out of memory

  1. 编译decode_wasm的emsdk 版本1.38.45 .希望这个在decode_wasm编译wiki里注明一下, 其他太新的版本编译可以通过,使用的时候有问题,加载不了。

好的,我更新下readme里面的版本信息。 内存的问题可以把播放器页面的console关掉再试一下。

fzw2408 commented 3 years ago

作者你好。我尝试通过发送PlayerChangeSrc 信号驱动:switchPlaylist / changeSrc 但是没有效果。 我的想法是:我播放一个流的时候想不重新new的情况下,直接服用旧的实列切换到另外一个流进行观看。 文档中有介绍一点,看的不是很清楚。。。 Example Example of rateList.

// let options = { rateList:[ {"url":"http://localhost/20190902/01/a5/029f8fad8868a7116f20d8ae5b075996.m3u8","id":51,"name":"720P","value":"720"}, {"url":"http://localhost/20190902/f0/db/ee545466ced38973a9d60fe7f24ed409.m3u8","id":51,"name":"高清","value":"600"}, {"url":"http://localhost/20190902/78/6c/5a5a99476f4f792e2e7a701ba1f6d5ad.m3u8","id":264,"name":"极速","value":"jisu"}, {"url":"http://localhost/20190902/54/05/7e714a321d9e7d92c937582b2e439833.m3u8","id":265,"name":"流畅","value":"300"}] }

changeSrc(url, callback) 这个有没有相应的demo啊?

yiwen03 commented 3 years ago

直接通过player实例对象调用这个方法就可以player.changeSrc('http://localhost:9011/gitwork/goldplay/h265player/data/video1/playlist.m3u8')

fzw2408 commented 3 years ago

player.changeSrc('http://localhost:9011/gitwork/goldplay/h265player/data/video1/playlist.m3u8') 流加载进来是黑屏,【Aurl=264 切换 Burl = 265】 hls流正常下载。 用了一个比较愚蠢的方法: changeSrc (url, callback) { this.pause() this.events.emit(Events.ControlBarPauseLoading, this) this.events.emit(Events.PlayerChangeSrc, this) this.changing = true this.seeking = false this.imagePlayer.firstRender = false this.readyStatus = { dataProcessor: false, firstData: false, audioPlayer: false } this.currentTime = this.startTime this.imagePlayer.clear() this.reset(true) this.autoPlay = true this.switchPlaylist(url, callback) setTimeout(() => { this.pause() this.play() }, 5000);

}

jarry commented 3 years ago

player.changeSrc('http://localhost:9011/gitwork/goldplay/h265player/data/video1/playlist.m3u8') 流加载进来是黑屏,【Aurl=264 切换 Burl = 265】 hls流正常下载。 用了一个比较愚蠢的方法: changeSrc (url, callback) { this.pause() this.events.emit(Events.ControlBarPauseLoading, this) this.events.emit(Events.PlayerChangeSrc, this) this.changing = true this.seeking = false this.imagePlayer.firstRender = false this.readyStatus = { dataProcessor: false, firstData: false, audioPlayer: false } this.currentTime = this.startTime this.imagePlayer.clear() this.reset(true) this.autoPlay = true this.switchPlaylist(url, callback) setTimeout(() => { this.pause() this.play() }, 5000);

}

这个加个了定时器是吗?好吧。。。

fzw2408 commented 3 years ago

/**