It is not possible to do this like you want as it would require modification to the RTSP headers at a very low level which is not possible.
Initially, I thought you may be able to use one of the IMediaStreamNameAliasProvider2 methods to do it but on closer inspection, I can see that there would be a problem with setting the application that the session connect to correctly.
The following rules are used to set the application name and stream name for an rtsp session. It looks at the path part of the URL (everything between rtsp://wowzaServer.com:1935 and ?UID=1234&Room=mystream in your case).
The path is split into parts on the path delimiters ("/") in your case, there would be one part `live`.With these rules in mind, you may be able to do the following with a slightly different url format.
If there is just one part, the application name is "_defapp_" which is the default name when no name is defined.
The stream name is the part. (live in your case).
If there are 2 parts, the application name is the first part & the stream name is the second part. The application instance name is _definst_.
If there are 3 or more parts, the application name is the first part, the application instance name is the second part and the stream name is the remaining parts joined back together with "/".
This will use the third rule (for 3 or more parts)
The IMediaStreamNameAliasProvider2.resolvePlayAlias(IApplicationInstance appInstance, String name, RTPSession rtpSession) method is called when the RTP stream is created to resolve the name that should be used for the stream, `UID=1234/Room=mystream` should be passed into the method as the name value. You can extract your own name out of this and return that.
I haven't tested this but it should work for both RTSP published streams as well as playback.
public String resolvePlayAlias(IApplicationInstance appInstance, String name, RTPSession rtpSession)
String parts = name.split("/");
for(String part : parts)
if(part.toLowerCase().startsWith("room") && part.indexOf("=") > -1)
name = part.subString(part.indexOf("=") + 1);
The playback stream would also be available directly by using the actual name as you would with a regular streaming url.
If you want to prevent the stream from being created then you return null from the resolvePlayAlias methods. Note: the interface also provides other resolvePlayAlias methods for other player types. You should make sure you return the correct values from these.