Results 1 to 10 of 10

Thread: get stream name with trascoder

  1. #1
    Join Date
    Mar 2011
    Posts
    12

    Default get stream name with trascoder

    Hi,

    I have an application on my Wowza server running with the stream class getPublishStreamName method I use to get the name of the streams that are running in my application, it is functioning normally, but when I enabled the transcoder in applying the method did not return more the list with the names of the streams in the application. have any configuration that has to be done apart from the transcoder to return the name of the stream that is running?

    e.g.
    List<String> list = client.getAppInstance().getPublishStreamNames();

    The above code snippet when I activate the transcoder not return to the list, without the transcoder operates normally.

    Israel Junior

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Israel,

    I'm not sure what you are asking. Do you mean the source stream for the transcoder, or all the transcoded streams?

    Richard

  3. #3
    Join Date
    Mar 2011
    Posts
    12

    Default

    the source stream for the transcoder. when I enable transcoder I no longer recover the source stream list of client.getAppInstance().getPublishStreamNames() this return empty to me.

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    What is the source, RTMP encoder? Something else?

    How/when are you doing getPublishStreamNames? With Flash call?

    package com.wowza.wms.example.module;
    
    import java.util.Iterator;
    import java.util.List;
    
    import com.wowza.wms.amf.*;
    import com.wowza.wms.client.*;
    import com.wowza.wms.module.*;
    import com.wowza.wms.request.*;
    
    public class ModuleGetLiveStreams extends ModuleBase {
    
    	public void getLiveStreams(IClient client, RequestFunction function,
    			AMFDataList params) {
    		
    		AMFDataObj streams = new AMFDataObj();
    		
    		List<String> list = client.getAppInstance().getPublishStreamNames();
    		
    		Iterator<String> iter = list.iterator();
    		while (iter.hasNext())
    		{
    			streams.put(iter.next(),iter.next());
    		}
    		sendResult(client, params, streams);
    	}
    }
    AS3 client-side
    function showStreams(obj:Object)
    {
    for (var prop:String in obj)
    {
    	trace("\t"+prop+":\t"+obj[prop]);
    }
    
    }
    nc.call("getLiveStreams", new Responder(showStreams));
    Richard

  5. #5
    Join Date
    Mar 2011
    Posts
    12

    Default

    I using Stream class API for streams the one playlist, follows the code :

    public void doCheckStream(IClient client, RequestFunction function, AMFDataList params) {
    		
    		String sName = getParamString(params, PARAM1);
    		getLogger().info("Check streaming : " + sName);
    		
    		Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(sName);
    		String sPlayList = (String)client.getAppInstance().getProperties().getProperty("PlayListName");
    		
    		PlaylistItem pls1 = null;
    		
    		if (stream != null)
    		{
    			pls1 = stream.getCurrentItem();
    		}
    		
    		AMFDataObj retObj = new AMFDataObj();
    		List<String> list = client.getAppInstance().getPublishStreamNames();
    		Iterator<String> iter = list.iterator();
    		while (iter.hasNext())
    		{
    			String sTeste = iter.next();
    			if (sTeste.equals(sName)) {
    				retObj.put("status", new AMFDataItem(true));
    				if (pls1 != null) {
    					retObj.put("val1", new AMFDataItem(pls1.getName()));
    				} else {
    					retObj.put("val1", new AMFDataItem("nulo"));
    				}
    				retObj.put("val2", sPlayList);
    					
    			} else {
    				retObj.put("status", new AMFDataItem(false));
    				retObj.put("val1", new AMFDataItem("nulo"));
    			}
    		}
    		
    		sendResult(client, params, retObj);
    	}
    follows the code that creates and opens the streaming playlist :
    public void doOpenPlayList(IClient client, RequestFunction function, AMFDataList params) {
    		
    		AMFDataMixedArray param1 = getParamMixedArray(params, PARAM1);
    		String sName = getParamString(params, PARAM2);
    		String sPlayList = getParamString(params, PARAM3);
    		
    		Playlist playlist = new Playlist(sPlayList);
    		playlist.setRepeat(true);
    		
    		int len = param1.size();
    		for (int i=0; i < len; i++) {
    			AMFDataObj valueObj = param1.getObject(i);
    			playlist.addItem(valueObj.getString("value"), 0, -1);
    		}
    		
    		IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
    		Stream stream = Stream.createInstance(vhost, client.getApplication().getName(), sName);
    		client.getAppInstance().getProperties().setProperty(sName, stream);
    		client.getAppInstance().getProperties().setProperty(playlist.getName(), playlist);
    		client.getAppInstance().getProperties().setProperty("PlayListName", playlist.getName());
    		
    		playlist.open(stream);
    		
    		sendResult(client, params, sName);
    	}
    follows the code on Flex 4.
    private function onCheckStatusToStream():void {
    				if (nc.connected) {
    					
    					var objRst:Object = new Object();
    					objRst.onResult = function(objRsp:Object):void {
    						if (objRsp["status"]) {
    							btnStreaming.label = "Stop";
    							txtDisplay.text = "Streaming : is Run !!!";
    							txtRum.text = "Video : " + objRsp["val1"];
    						} else {
    							txtDisplay.text = "Status : Stop";
    							txtRum.text = "";
    						}
    					};
    					
    					nc.call("doCheckStream", new Responder(objRst.onResult), sName);
    					
    				} else {
    					Alert.show("Failure !!!", WEBTV);
    				}
    			}
    the above code works without activating the transcoder but if I activate it does not work.

    Thanks in advance.
    Israel Junior

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Israel,

    Thanks for the detail and example. I will test.

    What version of Wowza are you using?

    Richard

  7. #7
    Join Date
    Mar 2011
    Posts
    12

    Default

    wowza version: 3.1.0

  8. #8
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    The Wowza Transcoder and the IDE do not work well together, that might be the problem. I tested in stand-alone (/bin/startup.bat) mode.

    I used the scheduler to produce a stream named Stream1 (Stream class stream also with sample.mp4 as source), and I used to IMediaStreamActionNotify3.onPlay() to test getPublishStreamNames() with Transcoder enabled and not.

    while (iter.hasNext())
    	{
    		String sTeste = iter.next();
    		getLogger().info("sTeste: " + sTeste);
    	}
    This ran when I played a stream in Flash RTMP client. This was output with Transcoder not enabled:
    INFO server comment - sTeste: Stream1
    This is with Transcoder enabled:
    INFO server comment - sTeste: Stream1_source
    INFO server comment - sTeste: Stream1_160p
    INFO server comment - sTeste: Stream1
    INFO server comment - sTeste: Stream1_360p
    Richard
    Last edited by rrlanham; 07-25-2012 at 05:28 AM.

  9. #9
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Also, take a look at this guide to using the IDE with the Wowza Transcoder:

    http://www.wowza.com/forums/showthre...ith-Transcoder

    Richard

  10. #10
    Join Date
    Mar 2011
    Posts
    12

    Default

    Thanks Richard, I'll try here too.

Similar Threads

  1. mpeg-ts adaptive streaming (without wowza trascoder)
    By mgrovy in forum Tutorials Discussion
    Replies: 6
    Last Post: 04-21-2012, 11:39 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
  •