简体   繁体   English

HLS.js 获取视频片段信息

[英]HLS.js get video segment info

I am trying to get analytics on hls.js from my video segments.我正在尝试从我的视频片段中获取有关 hls.js 的分析。 I am looking for the size of the video segments and what time the video segments go over the network.我正在寻找视频片段的大小以及视频片段通过网络的时间。

I am currently using the HLS events with not much luck:我目前正在使用 HLS 事件,但运气不佳:

this.hls.on(HLS.Events.BUFFER_APPENDING, (event, data) => {
    console.log(data);
    console.log('segment added to buffer');
});

I've tried BUFFER_APPENDED, BUFFER_APPENDING, FRAG_CHANGED, without much luck getting the info I want.我试过 BUFFER_APPENDED、BUFFER_APPENDING、FRAG_CHANGED,但没有多少运气得到我想要的信息。

FRAG_BUFFERED or LEVEL_LOADED event should have stat information you need. FRAG_BUFFEREDLEVEL_LOADED事件应该有你需要的统计信息。

Demo folder in repository has good level of stats collection you might be able to use it for collecting stats: https://github.com/video-dev/hls.js/tree/master/demo存储库中的演示文件夹具有良好的统计信息收集水平,您可以使用它来收集统计信息: https : //github.com/video-dev/hls.js/tree/master/demo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM