Comments (12)
We already have this information in our big demo:
Git: https://github.com/Novage/p2p-media-loader/tree/master/p2p-media-loader-demo
Hosted: http://novage.com.ua/p2p-media-loader/demo.html
Small demos (like this demo) are intended to be as simple as possible and you are free to copy them and extend for your needs.
from p2p-media-loader.
@mrlika yes i saw the big demo, but if someone want to test the performance with big number of users is not going to use the big demo, and put it in his website for like 20k users you know what i mean.
i don't know how to add it myself, can you show us what we should add in this code to console how much data has been transferred via P2P vs HTTP
<script>
if (p2pml.hlsjs.Engine.isSupported()) {
var engine = new p2pml.hlsjs.Engine();
var player = new Clappr.Player({
parentId: "#video",
source: "https://akamai-axtest.akamaized.net/routes/lapd-v1-acceptance/www_c4/Manifest.m3u8",
hlsjsConfig: {
liveSyncDurationCount: 7, // To have at least 7 segments in queue
loader: engine.createLoaderClass()
}
});
p2pml.hlsjs.initClapprPlayer(player);
player.setVolume(1); // 1%
player.play();
this.engine.on(p2pml.core.Events.PieceBytesDownloaded, this.onBytesDownloaded.bind(this));
this.engine.on(p2pml.core.Events.PieceBytesUploaded, this.onBytesUploaded.bind(this));
} else {
document.write("Not supported :(");
}
</script>
from p2p-media-loader.
For this particular demo you can do it like this (better before calling play):
engine.on(p2pml.core.Events.PieceBytesDownloaded, (method, bytes) => {
console.log('download', method, bytes);
});
engine.on(p2pml.core.Events.PieceBytesUploaded, (method, bytes) => {
console.log('upload', method, bytes);
});
You can modify the code to summarize total P2P and HTTP or, for 20k viewers, it is better to send the statistics somewhere to be stored for further analytics.
from p2p-media-loader.
ok thanks, i have one more question.
what are the of a server specifications (bandwidth, cpu, ...) that i will need to test this library for 20k viewers with non HD video i will test it with 520p ? ( and if you have some hosting suggestions, cheapest once because you know i'm doing this just for testing purposes )
from p2p-media-loader.
On the server side the library uses webtorrent tracker. It just exchanges peer connection information (like a torrent tracker). It doesn't deal with data that is sent between peers so video size doesn't matter:
https://github.com/webtorrent/webtorrent
or
https://github.com/DiegoRBaquero/uWebTorrentTracker
By default public webtorrent trackers are used but I think for your 20k users swarm you should run your personal webtorrent tracker and configure it with the library.
Webtorrent tracker doesn't require much CPU and bandwith.
from p2p-media-loader.
@mrlika sorry i forgot to mention i wasn't talking about the tracker, i meant what's server's requirements (bandwidth, cpu, line ...) to serve the actual live video. for the tracker i can use just azure or something.
from p2p-media-loader.
Tracker should not use a lot of CPU and bandwidth but I didn't test it with 20k users.
from p2p-media-loader.
ok thanks, i was just wondering if you have some informations about the required server to serve a video 520p to that number of users ( again not talking about the tracker, i'm talking about rtmp server ).
it's weird i searched about it for hours but i didn't find an article or someone talks about server requirements to serve live video to a lot of users.
from p2p-media-loader.
P2P Media Loader doesn't support RTMP. It supports segmented streams: HLS and DASH.
To host HLS or DASH you need HTTP server and you have to calculate bandwidth, CPU requirements of your HTTP server and CPU requirements of software that generates the stream (i.e. transcoding etc.)
But if you do not have horizontally scalable HTTP servers infrastructure I recommend for the 20k users test use a CDN and deliver HLS/DASH stream using it.
Because if your stream is 1 Mbps for 20k users in worst case they will download with 20 Gbps speed.
from p2p-media-loader.
@mrlika ok thanks, do you have any cheap CDN suggestions ?
from p2p-media-loader.
@Er-rchydy check out wowza cloud they are using akamai and will allow you to use their cdn for 20.000 concurrent without any annual commitment but pay as you go
from p2p-media-loader.
@f1l1b0x thanks, do you have any idea about how much it would cost, because i'm doing this for testing purposes.
example: video: 520p fixed, live for 2 hours, 20.000 visitors watching the whole live at the same time, how much it would cost at this scenario, average price of course
from p2p-media-loader.
Related Issues (20)
- someone trying to repair this repo?
- is there any way to stream video from torrent file
- How do I add my wt-tracker to p2p-media-loader? HOT 1
- p2p loader can't work on google chrome version 110.0.0.0 HOT 1
- Not working in the latest version of Chrome HOT 4
- Create 3 folders with NPM packages
- Create simple hls.js loader plugin
- WebSocket connection to 'wss://tracker.novage.com.ua/' failed: HOT 1
- How to integrating into Reactjs HOT 1
- Peers wont connect !! HOT 5
- Working on firefox and old chrome browsers but not working with latest versions of chrome please help. HOT 7
- Peers are not connecting cross-browser for example chrome peers only connecting with Chrome peers and Firefox only connecting with Firefox peers. Anyone knows the solution ?
- Does the next version support videojs? HOT 1
- Anyone have luck installing on JW Player?
- Release v1 HOT 2
- Not Working P2P HOT 2
- host in mau domain pleass anser HOT 1
- p2pδΈε·₯δ½ HOT 4
- V1 Can't start HOT 2
- test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p2p-media-loader.