We have a set of live streams that we publish using Adobe Flash so people can view them through their browser. We use a CDN to distribute the stream. We want to count the number of concurrent users connected to a given stream, with about a 10 second accuracy. We know we can do this using Adobe Flash Media Server (FMS).
Using FMS for this feature only seems overkill. It would add to our infrastructure requirements and the licensing cost is not cheap either. We would prefer not to have to maintain FMS since the only feature we would be using is concurrent viewers.
How can we count the number of users connected to a stream?
We have thought of these options so far:
1) Build a web service that the Flash client "pings" every 10 seconds with a video ID. The web service will return the number of users viewing it (based on the number of connections passing that particular video ID).
2) Build a low-level TCP service that the Flash client opens a socket connection to, passing the video ID and having a return value of the number of users viewing the video that at that moment (based on the number of connections passing that particular video ID).
Any better ways?