Giter VIP home page Giter VIP logo

hlsjs-p2p-engine's People

Contributors

rafa8626 avatar snowinszu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hlsjs-p2p-engine's Issues

No P2P

Hi,
since 1-2 days there's no P2P in your demo and the "quick demo html page".
Someone changed something, you or hls?

p2p experience is always better after restart.

Hi, I researched the work of p2p and found a strange pattern.

My details.
Vod 2 level
720 & 480
try connect 17 ~ 25 peers

chunk = 2.5mb ~ 5mb. (720p) 8 sec.

segmentId: function (level, sn, tsUrl) {
                id=tsUrl.split('?')[0];
                const formatedUrl =id.split('/')[id.split('/').length-1]+level+"&"+sn;
                return formatedUrl;
                }

Basically, all users are watching 720p.

A minute after the start, 4-7 peers remain. And in most cases it is being downloaded from a CDN. If i reboot p2pengine
p2p.disableP2P (); p2p.enableP2P (); (p2p = P2Pengine object)

That peers will be much more and start downloading via p2p. What is the logic for assigning peers? in p2p.tracker I found p2p.tracker.failedDCSet as I understood the black list of peers and requestMorePeers ()
Can this be used for better results?

And why in the documentation there are no dcTolerance and dcUploadTimeout settings?

It seems to me that sometimes an error occurs with the levels when the system finds a file of another level and therefore another segmentid.

debug

peers: 7 idle peers: 7
cdnbye@latest:1 found sn 69 from peer 86bf8f85bd4123a2
cdnbye@latest:1 request criticalSeg segId n_69_0_0.ts1&69 at 69
cdnbye@latest:1 loading frag 69
cdnbye@latest:1 DC_PIECE_NOT_FOUND
cdnbye@latest:1 critical request timeout
cdnbye@latest:1 datachannel timeout while downloading from 86bf8f85bd4123a2
cdnbye@latest:1 P2P timeout switched to HTTP load n_69_0_0.ts?nimblesessionid=516858&expires=1554572845&md5=KXQawexOQd9Ray8oJXrYQQ at 69
cdnbye@latest:1 segment pool add seg n_69_0_0.ts1&69 level 1

Idle Peers

How to have higher number of idle peers?

https://prnt.sc/kk6a3l

Are there any tips? Maybe shorter hls fragments. My hls fragments is currently set at 10s.
Or is there any settings that i can tune within your library?

那个,我来给你们添加麻烦了

那个,可以不可以自己的服务器作为转发节点,给点播用户传送资源呢?

m3u8资源都是国外的,wss用国内的好还是国外的好

如果自己弄wss,套上CF,并且做CF优化是否可以呢

CF优化就是不同地方指定不同的CF ip达到最佳效果

Tracker unresponsive

First of all, great start on the project. There are some problems here but the biggest issue is the tracker setup. There is some functionality obfuscated away in the package cdnbye-core, which makes it almost impossible to fully debug.

This seems to prevent the implementation of any third party trackers. Which leaves the only solution being your own tracker service. However, this service is inconsistently available and is often returning timeouts and 5xx errors, which prevent playback in some cases ( in others it falls back to http gracefully ).

Secondary tracker issue, is the way in which peers are selected.. the client is receiving the same list of peers every time they are requested, and it doesnt seem to have any kind of targeting.

So this puts the project in a bit of an unusable state. I would suggest either writing a protocol specification so that people can make their own trackers, or some kind of licensing on it if you really need to make money.

What can we do here?
This kind of prevents natural growth of the project in terms of open source development.

announce config option

Would it be possible to have an array instead of a single string? So more trackers could be used on it.

URI Malformed (hlsFragLoaded)

Describe the bug
Upon loading a .vtt file (subtitles), it seems p2p-engine dies.

Additional context

[error] > An internal error happened while handling event hlsFragLoaded. Error message: "URI malformed". Here is a stacktrace: URIError: URI malformed
    at encodeURIComponent (<anonymous>)
    at Object.decode (app.js:23867)
    at Le.parse (app.js:23867)
    at app.js:23867
    at Array.forEach (<anonymous>)
    at Object.parse (app.js:23867)
    at t._parseVTTs (app.js:23867)
    at t.onFragLoaded (app.js:23867)
    at t.e.onEventGeneric (app.js:23867)
    at t.e.onEvent (app.js:23867)
    at r.emit (app.js:23867)
    at r.a.trigger (app.js:23867)
    at t.loadsuccess (app.js:23867)
    at app.js:23867
    at o (<anonymous>:1:157321)

Expected Behaviour
.vtt files should not be loaded over p2p.

Signaling server

Hi there,

I guess that the signaling server will not be open sourced, right?

Thanks, and great job!

WebRTC Connection cannot be established on MacOS Safari

Describe the bug
Unhandled Promise Rejection: TypeError: Argument 1 ('options') to RTCPeerConnection.createOffer must be a dictionary

To Reproduce
Steps to reproduce the behavior:

  1. Use your demo page and open it in Mac Safari

Expected behavior
To establish a P2P connection via WebRTC

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS
  • Browser [e.g. chrome, safari] Safari
  • Version [e.g. 22] 12

Additional context
Unhandled Promise Rejection: TypeError: Argument 1 ('options') to RTCPeerConnection.createOffer must be a dictionary

openplayer problem with integration

Hello.
I'm trying to integrate cdnbye into a new player.
https://github.com/rafa8626/openplayer
In the description it is said that he has a relationship with mediaelement.

In the settings I use the standard construction:

  hls: {
          debug: true,
          p2pConfig: {
              logLevel: 'debug',
           }   
        }

HLs has been initialized
Imgur

And setting p2p is added to the config

Imgur

But cdnbye did not start

P2P Streaming Logic

I need to know the logic when peers connect to each other.
For example a separate tab(Child tab) opens when i click on "Create New Peer".
According to my understanding the first tab always serve as main and other tabs are connecting as child to it and they receive stream from the main tab.

So are child tabs always connected to main and receive stream from it or child tabs also serve as main for other tabs to forward stream?

Can you please clarify this concept.

fragParsingError

Describe the bug
Using AES-128 with a HLS adaptive bitrate playlist, 1000 errors per second are thrown:

errorType mediaError details fragParsingError errorFatal false

Disabling P2P makes the video work.

To Reproduce
Steps to reproduce the behavior:
Contact me via email (REDACTED) so I can host the playlist for you, so you can see the exact issue.

Expected behavior
Play the video without throwing an error.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Mac OS
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 69

http stream does not play

Hi
works fine with https streams, but http streams do not work
is it possible to play http stream?

Docker container

Could you please create your p2p engine in docker container ?

tracker service address

Hi

在 ·src/bittorrent/index.js· 中有如下配置 , 请问tracker服务器跟signaler服务器有什么区别? 我们可以向自己部署signaler那样去部署tracker服务器么? 谢谢.

let config = {
announce: "https://api.cdnbye.com/v1", // tracker服务器地址
urgentOffset: 3, // 播放点的后多少个buffer为urgent
};

a simple Tracker written by PHP

https://github.com/linkec/hlsp2p-php-tracker

a tracker for HLSjs-p2p-engine written by PHP
1.Install Nginx+PHP enviroment,whatever you are using Windows OR Linux(Better)
2.Set the Nginx rewrite rule
location / {
try_files $uri $uri/ /?$args;
}
3.Enjoy

BTW Apache is able to serve this file, but I am not sure how to write rewrite rule,Any one help us to improve?

基于PHP编写的 HLSjs-p2p-engine Tracker
1.安装Nginx和PHP环境

2.设置Nginx的伪静态

location / {
try_files $uri $uri/ /?$args;
}
完事儿~

Tracker?

I need make own tracker server and Signal server! Please help me!

p2pConfig options

Please, can you provide the available p2pConfig options? also, setting logLevel to false is enough?
Also, what are the optimal settings for HLS (segment length, duration)?
Great lib, thank you so much

relative chunks uri problem.

Hi! I'm wondering if is possible to define the chunk url with a regex patter or something.

i founded that cdnbye not working with urls that have different subdirectories on it.

example.com/clientid1/channelnumber/file.(ts|m3u8)
example.com/clientid2/channelnumber/file.(ts|m3u8)

it's possible to add some regex expresion or whatever in the config to help detect this differents urls as the same?

Tracker Server

Hi!

First of all I want to thank you on that project 😄
Second, as part of this project you published the repository of the signaling server, but I don't see the tracker server source code as well.. it's by reason? it's a well known tracker server, or it's your own implementation for that project?
Will glad if you can share a link for it, either yours or generic one.

Thanks!

Video won't reproduce with advertisement

Description: I was testing CDNBye with jwplayer + ads and I ended up finding a strange bug, basically when the player is configured with ads (tested with google IMA and VAST) it just does not start, just get a button to give play that has no action. When the player does not find any ads to show, he usually plays.
Seeing the console, I noticed that it has an error related to jwplayer.js: "Error in "beforePlay" event handler: TypeError: Cannot convert undefined or null to object"

Steps to reproduce:

  1. Go to https://jsfiddle.net/u3Ld2nsw/
  2. Open browser console and hit play button
  3. See error on console and the video not playing

Tested with:

  • OS: Windows
  • Browser: Chrome
  • Version: 67.0.3396.99 (Versão oficial) 64 bits (cohort: Stable)
  • Browser: Firefox
  • Version: 61.0.1 (64-bit)
  • Browser: Microsoft EDGE
  • Version: 42.17134.1.0

I tested it with jwplayer, not sure if this happen to others players

backend can not create the .club domain

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
image

502 Error

I'm receiving 502 from the tracker.

Open Source the Dependencies

Hello, there is this field announce with description The address of tracker server.

Is it nowhere to be found under your company repository.

  1. What exactly does it do?
  2. Is it possible to open source it?

p2p not working behind router

The recent v0.2.0 causes http segments not to load at all if p2p fail.
The previous version at least load http segments if p2p fail.

DC_PIECE_NOT_FOUND

Hello

I had a problem after adding an additional level of quality.
Of the 25 peers that I found the tracker, I could only connect to 10.
After each attempt to download a segment, I get an error:

frag changed: 31
cdnbye@latest:1 peers: 9 idle peers: 9
cdnbye@latest:1 found sn 47 from peer d9e06245e71148e2
cdnbye@latest:1 request criticalSeg segId https://.../vod1/s1/10629/1/11.mp4/n_47_0_0.ts?nimblesessionid=18826&expires=1553179566&md5=P3zNbSqDA5XfXk9CTzRSjg at 47
cdnbye@latest:1 loading frag 47
cdnbye@latest:1 DC_PIECE_NOT_FOUND

code setting:

channelId: function(m3u8Url) {
                    var formatedUrl = 'anivid.tk<?php echo $_GET["vid"]; ?>/ch'+channelwidth; // format a channelId by removing the different part
                    return formatedUrl;
                },
                segmentId: function (level, sn, tsUrl) {
                // const formatedUrl = `${level}-${sn}`;  // default implementation
                 const formatedUrl = tsUrl;  // the actual path of ts file
                return formatedUrl;
                }

channelwidth = 720 or 480

Some problem with p2p-engine

After used plugin for a while, I faced with some problem:

  • p2p performance not good when ts file has large size. (maybe cause bandwidth of client)
  • With difference network, so many time peer A cannot connect to peer B though I used TURN and STUN server. (sometime it's working).
    I hope u can have solution for this problems

ABR stream with level in URL

Hi,

I'm testing with ABR streams where levels are done in folders like:

http://DOMAIN/live/streamname/tracks-v1a1/2018/07/06/18/28/46-10000.ts
http://DOMAIN/live/streamname/tracks-v2a1/2018/07/06/18/28/46-10000.ts
http://DOMAIN/live/streamname/tracks-v3a1/2018/07/06/18/28/46-10000.ts
http://DOMAIN/live/streamname/tracks-v4a1/2018/07/06/18/28/46-10000.ts

The playlist contain relative URL's:
/2018/07/06/18/28/46-10000.ts

This means segments are shared for different levels and HLS displays them incorrectly.

I can't change the URL's or the playlists to be absolute URL's.

Could hlsjs-p2p-engine be extended to also look at the level HLS is using?

Video-js

Hello is this compatible with the latest video-js 7 ?

kind regards

Big problem with disconnect.

Good day.
If the server that broadcasts the video freezes or disconnects from the network, a very scary scenario will start.

The player starts constantly reconnecting to the network, ignoring the settings hls: fragLoadingTimeOut / manifestLoadingTimeOut / levelLoadingTimeOut
In the p2p information in totalP2PDown, the bytes begin to grow, and the RAM and the processor begin to fill with empty information.

Please check this event scenario.

Hlsjs v 11.0

Good day, when will support hls.js 11.0 version in cdnbye@latest?

cannot sign up here https://oms.cdnbye.com/#/signup

Hi, I cannot get the code to proceed with the sign up process.
After entering my email address and clicking the send button I see a 10000ms timeout exception.

I would like to register to try my player (custom but based on hls.js)

thanks for your attention

Sometimes the tracker does not work.

Good day, very often p2p network does not work. There is an induction of the video, and the feasts are not visible.
In the developer tools, I saw that the p2pEngine tree is smaller.
There are no requests to the signaler and the tracker.
This is a valid load
Imgur
And this load is in error
Imgur

Cordova 支持

现象总结

运行环境 官网demo 源码demo(运行在本地服务器)
Andorid Codorva 无法测试 运行成功,但是p2p模式未启动
Andorid Codorva Iframe 嵌套测试正常 运行成功,但是p2p模式未启动
Android Brower(常用浏览器) 正常 运行成功,但是p2p模式未启动
桌面浏览器(谷歌) 正常 运行成功,p2p模式正常启动

描述

发现一个有趣的问题,在Cordova环境中访问嵌套贵站的demo时,p2p模式可以生效,在手机浏览器中也可以。但是使用了源码中的[demo][https://github.com/cdnbye/hlsjs-p2p-engine/tree/master/demo]时,p2p模式没有启用,而是直接访问的cdn。

直接使用手机浏览器访问运行了源码中demo的服务也是没有生效,但是同一地址使用桌面浏览器却是可生效的。我的手机浏览器支持webRtc,而且访问demo也是完全正常。

当我把demo中的html源码弄下来运行时,发现403异常,想必是refer受到限制。

这方面的文档太少。希望作者抽空解答一下为什么手机浏览器访问源码demo时p2p没工作。

Connection Timeouts alot

Hi

i would like to know if there are any way to make cdnbye request same segment from 2 or more peers at the same time to avoid all that timouts and get a smooth streaming.
i've set my segment duration to 2 sec and each ts is about 1 to 2 MB but still get timed out and has to download from the HTTP.

is there a way to make this work better or is there any optimization you prefer for a better stream?

is there anything else blocking the peers to exchange data? i see all the peers and connected to them but it times out almost 100% of the time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.