Hi.
I am running WowzaStreamingEngine 4.0.0 on a Solaris box. I want to set cron jobs to start and stop streams and recordings.
The part about starting and stopping streams works fine with the JMXCommandLine tool.
The recording part is proving to be a little bit harder. Is the LiveStreamRecordManager module usable from the JMX interface?
I do not want to use the AutoRecord since I want to bring the stream up about 10 to 15 minutes before I start the recording and stop it before I stop the stream.
I have attempted to modify JMXCommandLine.java and here is a diff output of my modifications to JMXCommandLine.java (I called the new file WowzaCTRL.java to keep things separate):
5c5
< public class JMXCommandLine
public class WowzaCTRL
47a48,50
public static final String CMD_STARTRECORDING = “startRecording”;
public static final String CMD_STOPRECORDING = “stopRecording”;
158a162,164
System.out.println(" “+CMD_STARTRECORDING+” [vhost:application/appInstance] [stream-name] [filename]");
System.out.println(" “+CMD_STOPRECORDING+” [vhost:application/appInstance] [stream-name]");
518a523,553
else if (args[argOffset].equalsIgnoreCase(CMD_STARTRECORDING))
{
System.out.println(args[argOffset]+" “+args[argOffset+1]+” “+args[argOffset+2]+” "+args[argOffset+3]);
AppConextName context = new AppConextName(args[argOffset+1], true);
String connectsName = MBEANNAME+“:vHosts=VHosts,vHostName=”+context.vhostName+“,applications=Applications,applicationName=”+context.appName+“,applicationInstances=ApplicationInstances,applicationInstanceName=”+context.appInstName+“,name=ApplicationInstance”;
ObjectName connectsObjName = new ObjectName(connectsName);
StreamRecorderParameters recordParams = new StreamRecorderParameters(connectsName);
recordParams.segmentationType = IStreamRecorderConstants.SEGMENT_NONE;
recordParams.versioningOption = IStreamRecorderConstants.OVERWRITE_FILE;
recordParams.fileFormat = IStreamRecorderConstants.FORMAT_MP4;
recordParams.outputFile = args[argOffset+3];
Object arguments = {args[argOffset+1], args[argOffset+2], recordParams};
String signature = {“java.lang.String”, “java.lang.String”, “java.lang.Object”};
doInvoke(connection, connectsObjName, “ILiveStreamRecordManager.startRecording”, arguments, signature);
}
else if (args[argOffset].equalsIgnoreCase(CMD_STOPRECORDING))
{
System.out.println(args[argOffset]+" “+args[argOffset+1]+” "+args[argOffset+2]);
AppConextName context = new AppConextName(args[argOffset+1], true);
String connectsName = MBEANNAME+“:vHosts=VHosts,vHostName=”+context.vhostName+“,applications=Applications,applicationName=”+context.appName+“,applicationInstances=ApplicationInstances,applicationInstanceName=”+context.appInstName+“,name=ApplicationInstance”;
ObjectName connectsObjName = new ObjectName(connectsName);
Object arguments = {args[argOffset+1], args[argOffset+2]};
String signature = {“java.lang.String”};
doInvoke(connection, connectsObjName, “ILiveStreamRecordManager.stopRecording”, arguments, signature);
}
When I try to compile this, the first problem is the argument I use in the “new StreamRecorderParameters()” function (connectsName).
The compiler complains with an “error: cannot find symbol” with a carat under the “e” in “connectsName”.
Another cannot find symbol error puts the carat under the “S” in the second “StreamRecorderParamaters” of that same command.
Finally, there are 3 cannot find symbol errors concerning the “IStreamRecorderConstants” lines.
My first problem (and perhaps solution to the others) is: what argument do I supply for the “new StreamRecorderParameters()” function; since I am not actually in any appInstance yet, I cannot use “this.appInstance”; I need to supply a name.
If the LiveStreamRecordManager module is ultimately not accessible from the JMX utility, I guess I will have to use telnet to send http commands, which is not nearly as elegant as using the JMXCommandLine, but would work.
Thanks.
Mike.