Wowza Community

Module Collection

Videoeditor,

The FTP server should be running, but check and make sure:

vsftpd start

Richard

I don’t think it will work with S3 or FSS3. It is Java. Here is the source:

package com.wowza.wms.plugin.collection.module;

import com.wowza.wms.amf.*;
import com.wowza.wms.application.IApplicationInstance;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
import java.io.File;
import com.wowza.util.FileUtils;
import com.wowza.util.IFileProcess;

public class ModuleVideoNameList extends ModuleBase {

	AMFDataMixedArray recordedMovies = new AMFDataMixedArray();
	String storageDir;
	
	class PutFile implements IFileProcess
	{
		public void onFile(File file)
		{
			String sizeSuffix="";
			String s = storageDir;
			if (file.length()<1024000)
			{
				sizeSuffix = "["+ Math.round((file.length() * .001)) + " kb]";
			}
			else
			{
				sizeSuffix = "["+ Math.round((file.length() * .000001)) + " MB]";
			}
			
			String fileName = file.getName();
			
			String _abpath = file.getAbsolutePath().replace("\\", "/");
			String _parent = file.getParent().replace("\\", "/");
			String _path = file.getPath().replace("\\", "/");
			
			
			
			fileName = fileName.replace(storageDir, "");
			String fn = file.getName().toLowerCase();
			if (fn.indexOf(".m4v")>-1 || fn.indexOf(".mov")>-1 || fn.indexOf(".mp4")>-1 || fn.indexOf(".f4v")>-1)
			{
				fileName="mp4:" + fileName;
			}
			
			if (file.length() > 0 && fileName.indexOf(".")>-1)
			{
				recordedMovies.put(fileName, new AMFDataItem(fileName.replace(".flv", "") + " " + sizeSuffix));
				getLogger().info("fileName: " + fileName);
			}
		}
	}
	
	public void getVideoNames(IClient client, RequestFunction function,
			AMFDataList params) {
		getLogger().info("getFiles");
		storageDir = client.getAppInstance().getStreamStoragePath();
		recordedMovies = new AMFDataMixedArray();
		
		IApplicationInstance app = client.getAppInstance();
		
		PutFile putfile = new PutFile();
		FileUtils.traverseDirectory(new File(app.getStreamStoragePath().replace("_definst_", app.getName())), putfile);
		sendResult(client, params, recordedMovies);
	}
}

To call this from Flash, here is an AS3 version. If you are using Flex, you an use the Bindable ArrayCollection with a ComboBox. In Flash CS you can change it to an Array

netconnection.call("getVideoNames",new Responder(videoNamesHandler));

[Bindable]
privat var recordedStreamsDP = new ArrayCollection();

private function videoNamesHandler(results:Object):void
{	
for( var item:String in results ) 
{
	var obj:ObjectProxy = new ObjectProxy(); // In Flex use ObjectProxy to populate Bindable ArrayCollection.
	obj.label = results[item];
	obj.value = item;
	recordedStreamsDP.addItemAt(obj,0);    
}
}

This should work in Flash AS3 or AS2:

var result:Object = new Object();
result.onResult = function(results:Object)
{
  for( var item:String in results ) 
{
	trace(results[item]);
	trace(item);
}  
}
netconnection.call("getVideoNames", result);

Richard

Right, add this Module to the end of your Application.xml Modules list:

<Module>
<Name>streamcontroller</Name>
<Description>ModuleStreamControl</Description>
<Class>com.wowza.wms.plugin.collection.module.ModuleStreamControl</Class>
</Module>

Updating readme…

Richard

You have to add this property also for the encoder:

<Property>
 <Name>AllowEncoder</Name>
 <Value>Wirecast</Value> <!--FM, Wirecast-->
</Property>

Richard

Shouldn’t be a conflict with MediaSecurity addon. Check the logf files, this module is reporting the value that the enocder is giving for Flashver. Look for a comment like:

Flashver: FM

But it wouldn’t be “FM”, something else. What it is, use that in the Property.

Richard

It would be in the access log. If this module is installed, it will write the Flashver to the log when the encoder starts publishing. So maybe it is the way you are using MediaSecurity package. I would remove the MediaSecurity module to debug.

Richard

This module won’t do it because it is just a snapshot, a point in time. As mentioned, you need to crunch the logs, and Sawmill has a Wowza module for that.

Richard

Removing the security package suggestion is to to step back so you can debug the first problem.

Now go back to the access logs and look for the comment that starts with "Flashver: " followed by something like “FMLE 3.5”, or something similar.

If you don’t see that, then the ModuleLimitConnectionsToApplication is not functioning. Double check the that the jar file is in the /lib folder. And post the whole Application.xml here.

Richard

Yes, all of these have source and they are all in this section along with many other Wowza Modules, HTTProviders and ServerListeners that you can use:

http://www.wowza.com/community/c/-/10

Richard

You will have install the latest JDK. You can download from here:

http://java.sun.com/javase/downloads/index.jsp

Richard

It should work with Mac. You can install the latest Mac JDK. See this page:

http://www.java.com/en/download/faq/java_mac.xml

(I am supposed to downgrade the Java version on this collection build, but I’ve made a couple of attempts at adjusting my environment that broke everything for me and I had to dig my way out of it and haven’t got back to it yet, sorry.)

Richard

Did you copy the jar file from the package to the Wowza lib folder?

Richard

Great, thanks for the update. Glad it’s working.

Richard

I added it to the list: “ModuleLimitPublishedStreamBandwidth”

http://www.wowza.com/forums/showthread.php?t=8465

Richard

Hi Richard,

I tried to use ModuleLimitConnectionsToApplication

<Module>
	<Name>ModuleLimitConnectionsToApplication</Name>
	<Description>Limit connnections to an application</Description>
	<Class>com.wowza.wms.plugin.collection.module.ModuleLimitConnectionsToApplication</Class>
</Module>

and add this to Properties

<Property>
	<Name>maxApplicationConnections</Name>
	<Value>200</Value>
	<Type>Integer</Type>
</Property>

after restarting Wowza then trying to connect using FM, it can’t connect. But when I remove that line, can be connected without any problems

also have tried inserting ModuleGetConnectionCount but have the same problem

can you please tell me why?

i’m using Wowza 2.0

You have to add this property also for the encoder:

<Property>
 <Name>AllowEncoder</Name>
 <Value>Wirecast</Value> <!--FM, Wirecast-->
</Property>

Richard

I already put FM

but my FME still can’t connect when I enabling that features.

Is there any problem if I use MediaSecurity aswell with this module collection?

Shouldn’t be a conflict with MediaSecurity addon. Check the logf files, this module is reporting the value that the enocder is giving for Flashver. Look for a comment like:

But it wouldn’t be “FM”, something else. What it is, use that in the Property.

Richard

i tried to find Flashver on access & error log, but can’t find any.

the errors give me a Not Responding FME responds

It would be in the access log. If this module is installed, it will write the Flashver to the log when the encoder starts publishing. So maybe it is the way you are using MediaSecurity package. I would remove the MediaSecurity module to debug.

Richard

I tried to remove MediaSecurity package.

But still can’t get anythink respond on my FME. My FME become not responding

Hi, thanks for the collection…

but I can’t get any results…

I’m working on: Wowza 1.7.2 - on Flash AS 2

I did all the steps: insert the additional module on the xml file, and insert on my project AS2 the codes you wrote on the guide.

My Netstream object name is: nsPlay

The stream name is “myStreamName” used on nsPlay.play(liveStreamName);

I call the following function after the succefull connection:

function getAccountInfo() {
var ncServerResults = new Object()
ncServerResults.onResult = function(count:Number)
{
	trace("server: "+count);
}
......
......
var streamName:String = myStreamName;
var ncStreamListResults = new Object()
ncStreamListResults.onResult = function(list:Array)
{
	trace("clients");
	for(var i:Number=0;i<list.length;i++)
		trace("["+i+"]: "+list[i]);
}
nc.call("getStreamClientIds", ncStreamListResults, streamName);
}

but the results is:

onMetaData presetname = Custom

onMetaData title =

onMetaData rating =

onMetaData keywords =

onMetaData description =

onMetaData copyright =

onMetaData author =

Could be the problem on the Ports settings? I have already open the ports: 1935, UDP 8086 and for testing use all the range from 6970-9999.

I would be very grateful for any help!

Thanks

I added ModuleGetConnectionCount to my application, but how do i view the viewers live, what application can i use to get this data?