Wowza Community

Segmentation duration not matching

Hi, I need to record a stream divided by files of exactly the same duration.

The problem is they’re always one or two seconds longer. I thought it was because the recorder waits for a key frame to close the current file and open a new one, so i tried by setting

recordParametersVideo.startOnKeyFrame = false

but the result is always the same.

Here is my code

StreamRecorderParameters recordParametersVideo = new StreamRecorderParameters(appInstance);   
recordParametersVideo.segmentationType = IStreamRecorderConstants.SEGMENT_BY_DURATION;
recordParametersVideo.segmentDuration = 10*60*1000;
recordParametersVideo.startOnKeyFrame = false;
recordParametersVideo.recordData = false;
recordParametersVideo.outputPath = "/some/dir/";	
recordParametersVideo.fileTemplate = "segment${SegmentNumber}";
recordParametersVideo.fileFormat = IStreamRecorderConstants.FORMAT_MP4;
		
final ILiveStreamRecordManager recorder = vhost.getLiveStreamRecordManager();
recorder.startRecording(appInstance, "streamToRecord", recordParametersVideo);

Wowza docs say:

public boolean startOnKeyFrame

Configures whether or not the recorder will wait until a video key frame is received to start writing packets to the output file, thus ensuring the first packet in the file contains a video key frame.

If so setting it to false shouldn’t cause duration differences.

May I have misunderstood the function of StreamRecorderParameters.startOnKeyFrame? Or maybe the cause of my problem is another one?