Wowza Community

Limit RTP-LIVE connections

I need to limit the number of incoming cameras that the wowza server can simultaneously connect to. The streams are RTP_LIVE, so a connection to the camera only occurs when a client wants to view a stream. But I need to limit the number of streams coming in from the gateway. I’m thinking that I could maintain a count for each connection started/stopped and then deny new connections when the limit is reached. But I’m not sure where in the API to intercept the RTP-LIVE connects. Any suggestions?



This was addressed in ticket #228085, but I am posting the response here as well:

This should be possible by creating an application-level property object that keeps track of the started streams. You can increment the property during onPublish, and reduce it during onUnPublish.

You can then add a listener during resolvePlayAlias that will check if a limit has been reached, and deny playback (return null).


I was only able to just now get around to implementing this suggestion to implement resolvePlayAlias to control the connection. Unfortunately our installations use .stream files and this interface cannot be used. So I still need some event to stop from starting and publishing the stream.

Hi Hadi,

As mentioned in your ticket, you should still be able to use .stream files with your resolvePlayAlias method. You will need to add the following code for your resolveStreamAlias method in order to do so.

    public String resolveStreamAlias(IApplicationInstance appInstance, String name)
        return MediaCasterUtils.handleStreamAliasFile(appInstance, name);