Wowza Community

recording delayed

Hi All,

I’m experiencing a weird issue. I’ve written a module that starts and stops live recording and 98% of times it works like a charm.
Sometimes it happens that the recording (triggered on the onPublish event of the IMediaStreamActionNotify3 interface) is started after the stream as been already closed and obviously it fails saying “Stream not found”!
Those streams don’t last very long, duration between 10 sec and 10 minutes, but these are standard durations for our application.

Here the code that starts the recording:

private void startRecording() {
String streamName = getRecordingStreamName();
if(this.recordingParams == null) {
        this.recordingParams = buildStreamRecorderParameters("somepath");
iApplicationInstance.getVHost().getLiveStreamRecordManager().startRecording(iApplicationInstance,iMediaRecordingName, this.recordingParams);

private StreamRecorderParameters buildStreamRecorderParameters(String outputPath) {
    StreamRecorderParameters params = new StreamRecorderParameters(iApplicationInstance);
params.fileFormat = IStreamRecorderConstants.FORMAT_MP4;
params.versioningOption = IStreamRecorderConstants.APPEND_FILE;
params.segmentationType = IStreamRecorderConstants.SEGMENT_NONE;
params.startOnKeyFrame = true;
params.recordData = false;
params.notifyListener = new RecorderActionNotifyImpl(this);
File file = new File(outputPath);
params.outputPath = file.getParent();
params.outputFile = file.getName();    
return params;

Any clue?