How to count viewers of ingest point live stream?
Hi!
At the moment, we are successfully streaming live video and audio with the use of ingest points. We defined couple of them, so that the source can push the stream to EMS, and we use the publicStreamName to access it directly with flash based video player. This works as expected and it has since we first set it up (couple of months ago).
Now we wanted to get some statistics from this kind of streaming. We were not looking for something fancy, just a simple way of logging when a user accesses a certain stream (identified maybe by stream name). We came across Evostream Web Services and included API and Event Notification System. Now this is where things became interesting. The plan was, to use the Event Notification capabilities to listen for certain events, for example "outStreamCreated" and "outStreamClosed". When the viewer would connect to the stream, out understanding was, that outStreamCreated would fire. That event has a payload and in there, we suspected, were some identifiers by which we would be able to determine which out stream was created and log it (into DB or file).
For some reason, the outStreamCreated was never firing. Nor the outStreamClosed. When we started to push the source stream to EMS, the inStreamCreated fired and when we stopped pushing the source stream, the inStreamClosed fired as expected. But when someone would connect to the publicStreamName of the ingest point, events were not firing. The stream was working, just the events never fired.
OK, so we suspected, that this maybe has something to do with ingest points. So we tried to pull a test rtmp stream by pullStream command; the plan was, to se if the events were firing when using pullStream (and having a configuration for streams – we noticed, that ingest points do not have any configuration listed if you issue listConfig command). By our surprise, we could not pull any streams into EMS. The config was written, we just could not get the stream to play with the correct RTMP url (rtmp://our_strea_server/live/Our_stream_name). In the log, we kept getting error, that the stream name was already in use, except it was not (except for this one pull stream).
Several hours later we figured out that pull stream starts to work, if you disable ingest points in the config.lua (set it to false). So this is my first question: Is our observation, that you can not do a pull stream and ingest points at the same time, correct and if it is, is this the desired way EMS operates or is this a bug?
When we finally could do pull stream, we continued our initial plan, to test if outStreamCreated and outStreamClosed worked with pull stream. It worked. When a client (viewer) connected to the stream, the appropriate event fired. So this brings me to the second (set of) question(s): Do ingest point not offer the same events and if not, how to work around this limitation. Do we have to configure something different? Do we have to "restream" an ingest point stream (by using its publicStreamName) in some way (so that it gets a configuration entry)? If so, how do we do this? We tried using aliases, but this was still not working (the statistics, the stream was working). We tried to do a pullStream by specifying a local path for stream source (rtmp://localhost/live/{publicStreamName}), but pullStream does not work if we have ingest points turned on.
Thanky you for your answers 🙂