Stringtype= streamName.substring(streamName.lastIndexOf("_") + 1); getLogger().info("type: " + type); // create a livestreamrecorder instance to create .mp4 files if (StreamType.aac.toString().equals(type)) { ILiveStreamRecordrecorder=newLiveStreamRecorderMP4(); recorder.init(appInstance); recorder.setRecordData(true); recorder.setStartOnKeyFrame(true); recorder.setVersionFile(true);
// add it to the recorders list synchronized (recorders) { ILiveStreamRecordprevRecorder= recorders.get(streamName); if (prevRecorder != null) prevRecorder.stopRecording(); recorders.put(streamName, recorder); } // start recording, create 1 minute segments using default content path getLogger().info("--- startRecordingSegmentByDuration for 60 minutes"); // recorder.startRecordingSegmentByDuration(stream, null, null, 60 * 60 * 1000); // start recording, create 1MB segments using default content path // getLogger().info("--- startRecordingSegmentBySize for 1MB"); // recorder.startRecordingSegmentBySize(stream, null, null, 1024*1024); // start recording, create new segment at 1:00am each day. // getLogger().info("--- startRecordingSegmentBySchedule every "0 1 * * * *"); // recorder.startRecordingSegmentBySchedule(stream, null, null, "0 1 * * * *");
// start recording, using the default content path, do not append (i.e. // overwrite if file exists) getLogger().info("--- startRecording"); recorder.startRecording(stream, false);
// log where the recording is being written getLogger().info( "onPublish[" + stream.getContextStr() + "]: new Recording started:" + recorder.getFilePath()); }