Results 1 to 2 of 2

Thread: a variable (Java) to identify the streams that have been published using an encoder

  1. #1
    Join Date
    Apr 2016
    Posts
    8

    Wink a variable (Java) to identify the streams that have been published using an encoder

    Hello,

    I want to add a stream listener only to the main streams that have been published using an encoder like FMLE not through smil or transcoder.

    I think that creating a listener on every onStreamCreate (clients who play| clients who publish) is not practical. And it will create a load on the CPU & the memory.

    I have found a way to get it working. I am not sure whether it is the best way. At least it works

    	public void onStreamCreate(IMediaStream stream) {
    		String UniqueStreamIdStr = stream.getUniqueStreamIdStr();
    		if (UniqueStreamIdStr.contains("_")) {
    			getLogger().info("onStreamCreate:.................................................... " +  UniqueStreamIdStr);
    			IMediaStreamActionNotify3 actionNotify = new StreamListener(this.vhost, this.appInstance);
    			WMSProperties props = stream.getProperties();
    			synchronized (props) {
    				props.put("streamActionNotifier", actionNotify);
    			}
    			stream.addClientListener(actionNotify);
    		}
    	}
    	public void onStreamDestroy(IMediaStream stream) {
    		String UniqueStreamIdStr = stream.getUniqueStreamIdStr();
    		if (UniqueStreamIdStr.contains("_")) {
    			getLogger().info("onStreamDestroy:.................................................... " +  UniqueStreamIdStr);
    			IMediaStreamActionNotify3 actionNotify = null;
    			WMSProperties props = stream.getProperties();
    			synchronized (props) {
    				actionNotify = (IMediaStreamActionNotify3) stream.getProperties().get("streamActionNotifier");
    			}
    			if (actionNotify != null) {
    				stream.removeClientListener(actionNotify);
    			}
    		}
    	}

  2. #2
    Join Date
    Apr 2016
    Posts
    8

    Default

    I have found that this will not going to work when using a mobile application for streaming. It's only tested with FMLE.
    I have tried streaming rtsp through mobile app but it doesn't give UniqueStreamIdStr. It is giving me "1" instead of "54587897_1".

Similar Threads

  1. Replies: 1
    Last Post: 04-07-2016, 11:15 AM
  2. How to identify a camera which connects to Wowza
    By BlueBerry in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 07-17-2012, 05:32 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
  •