linuxbashant-media-server-sdk

How can I ask from Ant Media Server the number of current viewers


I tried in this way:

netstat -a | grep EST|grep -v localhost| grep \:5080| cut -d' ' -f 16-17|cut -d':' -f1|sort|uniq|wc -l

But it obviously can't show viewers from same ip. Surely there is a better way to do this...

Thank you!


Solution

  • do you want to access your total viewers count?

    You can reach the viewer numbers with the REST Service. Could you please check this https://antmedia.io/rest/#/BroadcastRestService/getBroadcastStatistics