logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
melody  
#1 Posted : Friday, March 25, 2022 11:28:45 PM(UTC)
Guest

Rank: Guest

Groups: Guests
Joined: 1/13/2010(UTC)
Posts: 230

hi all,

if you are using the amazing LiveLan feature, i would like to share with you a script that work as a counter to see how many people are watching live.

so, this is a simple counter and the logic is a ".bat" file, running on loop, containing a PowerShell script that is showing all "Established" connections to the port 8088 (default port for Web Controller).

It updates every 5 seconds and save the information on a ".csv" file that can be imported as an Excel/CSV Data Source.

This worked for me on W10 and W11

1. Start stream to LiveLan;

2. Copy the code bellow and save it on a ".bat" file;

:loop
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "Get-NetTCPConnection -Localport 8088 -State Established | Measure-Object -Line | Export-Csv -Path C:\stats.csv"
timeout 5
cls
goto loop

3. You can change the location of "stats.csv" by changing above "C:\stats.csv" to whatever you want to locate your file;

4. Run your ".bat" file and let it work, it can be minimized (if you get a red error is just because you don't have any established connection, make sure you pasted the code correctly, if yes don't worry, let it work even so);

5. Go to "Data Sources Manager", click "+" and choose "Excel/CSV";

6. Write whatever name you want, click "Browse", find the "stats.csv" file on root of C Drive;

7. Click Use first row as Column names and "OK"

There you have the information about how many lines (viewers) are connected;

hope it helps your production,

cheers

melody
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.