illuspas / Node-Media-Server

A Node.js implementation of RTMP/HTTP-FLV/WS-FLV/HLS/DASH/MP4 Media Server
https://www.npmjs.com/package/node-media-server
MIT License
5.96k stars 1.52k forks source link

How can I detect bandwidth of incoming video ? #205

Open vienntbna opened 5 years ago

vienntbna commented 5 years ago

Hi. This is a great project, I love it. I'm trying to detect some information of incoming rtmp video, like :

Like this https://i.imgur.com/sa5FmDI.png

Is it possible ? Thank you

victorcastelan commented 5 years ago

Yes, Try linking to your url api like this: (replace the ip to your own ip) http://192.168.0.1:8000/api/streams

... "publisher": { "audio": { "codec": "AAC", "profile": "LC", "samplerate": 44100, "channels": 2 }, "video": { "codec": "H264", "width": 1280, "height": 720, "profile": "Baseline", "level": 3.1, "fps": 29.97 }, ...

and for bitrate try this: (replace ip and "mystream" with your own stream)

http://192.168.0.1:8000/api/streams/live/mystream { isLive: true, viewers: 4, duration: 5, bitrate: 1581, startTime: "2019-06-26T22:24:22.964Z" }