Results 1 to 4 of 4

Thread: Liverepeater-edge play() problem with invalid stream

  1. #1

    Default Liverepeater-edge play() problem with invalid stream

    Hi, i have a problem in my wowza plataform.

    For example:

    I have 1 origin server and 1 edge server.

    In my edge server i have <OriginURL>rtmp://HOST.....</OriginURL>

    When the edge call the origin url if the stream is not valid is possible to give a error "rtmp Failed to play streamname; stream not found".

    I had a plugin that overwrites plays in the edge servers:

    public void play(IClient client, RequestFunction function,
    			AMFDataList params) {
    		if (!ret.getStatus()) {
    		} else {, function, params);

  2. #2
    Join Date
    May 2013


    It sounds like you might be looking to dynamically resolve the origin. If this is the case, you might checkout the following IMediaStreamNameAliasProvider2 interface.

  3. #3
    Join Date
    Dec 2007


    One way to check if an origin stream is running is to ask the origin using a Module or HTTPProvider. For example, with a module like this on the origin, a Flash RTMP client could connect to the origin and find out if the stream is live.

    package test;
    import com.wowza.wms.amf.*;
    import com.wowza.wms.client.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.request.*;
    public class ModuleCheckStream extends ModuleBase {
    	public void isStreamLive(IClient client, RequestFunction function,
    			AMFDataList params) {
    		Boolean streamExists = false; 
    		String streamName = getParamString(params, PARAM1);
    		MediaStreamMap streams = client.getAppInstance().getStreams();
    		IMediaStream stream = streams.getStream(streamName);
    		if (stream != null)
    			streamExists = true;
    		sendResult(client, params, streamExists);
    Or use an HTTPProvider

    package test;
    import java.util.List;
    import java.util.Map;
    import com.wowza.wms.application.IApplicationInstance;
    import com.wowza.wms.http.*;
    import com.wowza.wms.logging.*;
    import com.wowza.wms.vhost.*;
    public class HTTPOriginStreamCheck extends HTTProvider2Base {
    	public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
    		if (!doHTTPAuthentication(vhost, req, resp))
    		String retStr = "false";
    		String streamName = "myStream";
    		String app = "live";
    		Map<String, List<String>> params = req.getParameterMap();
    		if (params.containsKey("app")) 
    			app = params.get("app").get(0);
    			if (params.containsKey("streamname")) 
    				streamName = params.get("streamname").get(0);
    				IApplicationInstance appInstance = vhost.getApplication(app).getAppInstance("_definst_");
    				if (appInstance.getPublishStreamNames().contains(streamName))
    					retStr = "true";
    		try {
    			OutputStream out = resp.getOutputStream();
    			byte[] outBytes = retStr.getBytes();
    		} catch (Exception e) {
    					"HTTPOriginStreamCheck: " + e.toString());

  4. #4
    Join Date
    Dec 2007


    Or you could use resolvePlayAlias in the IMediaStreamNameAliasProvider2 and use the same method to see the stream is published. In this case you will look on the edge. This would give you the opportunity to send a message to the Flash RTMP client (which you can listen for with the NetConnection NetStatusEvent handler), and/or return another stream instead

    public String resolvePlayAlias(IApplicationInstance appInstance,
    			String name, IClient client) {
    		getLogger().info("Resolve Play Flash: " + name);
    		if (!appInstance.getPublishStreamNames().contains(name))
    			sendClientOnStatusError(client, "error.code", "description");// you are sending to the NetConnection in this case rather than the NetStream, which is a little awkward, but if the client is custom you can do whatever you want with notifications 
    // OR (instead of line above), you could create a server-side stream and return a reference to it, or have one running (using the scheduler) for this purpose and just return the name 		
    			Stream stream = Stream.createInstance(appInstance, "newStream"); // this might already exist, a looping server-side stream you use for filler."mp4:sample.mp4", 0, -1, true);
    			return "newStream";
    		return name;

Similar Threads

  1. server side play stream with liverepeater-edge application
    By dmitriy.kirakosyan in forum Live Streaming and Encoder Discussion
    Replies: 5
    Last Post: 03-27-2012, 06:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts