xqq / mpegts.js

HTML5 MPEG2-TS / FLV Stream Player
Apache License 2.0
1.64k stars 206 forks source link

内存,cpu占用高! 用flv 播放h265和h264 #185

Open LxbNNN opened 3 months ago

LxbNNN commented 3 months ago

开发电脑:macbook pro m1

config配置: 3701713521281_ pic

版本:1.7.3 3711713521297_ pic_thumb

内存和cpu情况: 内存会一直升高,cpu最高占用50%,测试的电脑有时最高会占用到70%(12代i5) 3751713521665_ pic

当使用了destroy() 方法后 内存会清理不完全 在空页面 内存任占用600m 左右 ,正常页面进入 大约在120m 左右

LxbNNN commented 3 months ago

同时播放了9路视频

wujisui commented 3 months ago

你把这里设置 autoCleanupSourceBuffer:false; 后面又设置 autoCleanupMaxBackwardDuration:10; 是不是有问题?

LxbNNN commented 3 months ago

你把这里设置 autoCleanupSourceBuffer:false;后面又设置autoCleanupMaxBackwardDuration:10;是不是有问题?

image 因为开启自动清理会报错,官方文档 autoCleanupSourceBuffer默认值也是false ,autoCleanupMaxBackwardDuration 到3分钟清理,我是直播,只是减少了清理的阈值,应该是没问题的,并且我观察内存,会在播一段时间降低一些,说明配置是生效的,随后才会逐步升高。

zui4yi1 commented 1 week ago

你把这里设置 autoCleanupSourceBuffer:false;后面又设置autoCleanupMaxBackwardDuration:10;是不是有问题?

image 因为开启自动清理会报错,官方文档 autoCleanupSourceBuffer默认值也是false ,autoCleanupMaxBackwardDuration 到3分钟清理,我是直播,只是减少了清理的阈值,应该是没问题的,并且我观察内存,会在播一段时间降低一些,说明配置是生效的,随后才会逐步升高。

应该要true吧