Wowza Community

Problems upgrading to ILiveStreamRecordManager

We had older version of wowza with application using ILiveStreamRecord . We are planning on upgrading to Wowza Streaming Engine 4.0 . Following is code for onPublish . As we have multiple stream recordings we maintain a list of recorders so that if exists we can stop on republish . Recording is fine but when reconnecting nothing happens , no log in wowza and Flash encoder just cant connect to wowza app . Is there anything I am doing wrong here ?

private HashMap<String, ILiveStreamRecordManager> recorders = new HashMap<String, ILiveStreamRecordManager>();
public void onPublish(final IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
		        String streamName = stream.getName();
			IApplicationInstance appInstance = stream.getClient().getAppInstance();
			IVHost vhost = null;
			vhost = appInstance.getVHost();
			ILiveStreamRecordManager recorder = recorders.get(streamName);
			if (recorder != null) {
				getLogger().info("Recorder already existed");
				recorder.stopRecording(stream.getClient().getAppInstance());
			}
			recorder = vhost.getLiveStreamRecordManager();
			StreamRecorderParameters srp = new StreamRecorderParameters(stream.getClient().getAppInstance());
			srp.outputPath = outputPath;
			srp.outputFile = outputFile;
			srp.segmentationType = IStreamRecorderConstants.SEGMENT_NONE;
			srp.versioningOption = IStreamRecorderConstants.APPEND_FILE;
			getLogger().info("Befre Recording: " + srp.outputPath + ":" + srp.outputFile);
			recorder.startRecording(appInstance, srp);
			getLogger().info("Started Recording: ");
			synchronized (recorders) {
				recorders.put(streamName, recorder);
			}
}

Is it possible to get some answer please ? Am I in wrong forum ? I have 7 wowza licenses and planning on upgrading . Please let me know if I should rather contact support directly .

So I was able to narrow it down to be this line causing the problem . On second time stream publish from Flash media encoder , when it tries to stop previous recorder it just crashed wowza application . Nothing happens on further publish .

recorder.stopRecording(stream.getClient().getAppInstance());

I have posted everything I could think of , will really appreciate some update on this thread . Thanks

To answer my own question I had to change it to use following method

recorder.stopRecording(stream.getClient().getAppInstance(),streamname);