Wowza Community

How can i know the Duration of any Stream on each Start/Stop Event from Wowza Logs?

Lets say i have Stream ABC and I start/Stop stream so many times in a day. I want to get the duration of stream between each Start/Stop event. I have the logs in the Database.

You could call the REST API at any time and get the stream “uptime” which tells you for how long a stream has been published. The API edge for this request would be:

/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/appName/instances/_definst_/incomingstreams/streamName/monitoring/current

If you can’t predict when the stream might start/stop then you should be able to utilize the IMediaStreamActionNotify interface to update/insert to your database during onPublish and onUnpublish events.

http://www.wowza.com/resources/serverapi/com/wowza/wms/stream/IMediaStreamActionNotify.html

https://www.wowza.com/docs/how-to-use-imediastreamactionnotify3-interface-to-listen-for-rtmp-stream-events-includes-codec-info

Currently in my database the Publish and Stop events are being inserted, can i get the duration directly from the database?