Wowza Community

Connect live stream after receiving a request to play by a client

If a client try to play a stream of my wowza media server, but there is not incoming stream active like http://wowzaserver:1935/live/myStream/manifest.mpd

¿Can I connect a stream file after the request made by the client?

Is there any module or a class in the api in Wowza to do that? I am thinking to do it with a http provider. ¿Is it possible?

If your clients are RTMP and/or RTSP you would just need to set your stream type to “rtp-live”. When using the “rtp-live” stream type in your application’s configuration file, the source stream will be published to Wowza only when the first client connects to the stream.

For HTTP streams to be active, the data packets need to be packetized. Wowza will start packetizing the HTTP stream as soon as the stream is published.

The stream is not published if there isn’t at least one client requesting the stream. So basically, an HTTP client can not be the first to request the rtp-live stream. Once the stream has been published by an RTMP client, HTTP clients can connect.

I hope this answers your question.




You can look into the onHTTPStreamerRequest method.

    public void onHTTPStreamerRequest(IHTTPStreamerSession httpSession, IHTTPStreamerRequestContext reqContext)
        String value = reqContext.getRequest().getHeader("Header-Name");

There are also similar methods for each of the separate protocols.

    public void onHTTPCupertinoStreamerRequest(HTTPStreamerSessionCupertino httpSession, HTTPStreamerCupertinoRequestContext reqContext)
    public void onHTTPSanJoseStreamerRequest(HTTPStreamerSessionSanJose httpSession, HTTPStreamerSanJoseRequestContext reqContext)
    public void onHTTPSmoothStreamingStreamerRequest(HTTPStreamerSessionSmoothStreamer httpSession, HTTPStreamerSmoothStreamingRequestContext reqContext)
    public void onHTTPMPEGDashStreamerRequest(HTTPStreamerSessionMPEGDash httpSession, HTTPStreamerMPEGDashRequestContext reqContext)

Thanks Salvadore.

Well, in the case of HTTP May I Have a filter or something like that? or in an event before, in a module try to connect the stream?

IApplicationInstance appInstance = vhost.getApplication(app).getAppInstance("_definst_");
appInstance.startMediaCasterStream(streamName, mediacasterType);

Is there a common event when a user try to play a stream HTTP like HLS or MPEG-DASH? I have seen that onHTTPSessionCreate only jump in the case of HLS.