How to set the stream name to recordParams in Auto Recorder

Shemar_Cox
Tue, 20 Apr 2021 09:39:27 +0000
Wowza Developer Dojo

hi,
I am making an automatic recorder referring to the module in the link below.

github.com

GitHub - WowzaMediaSystems/wse-plugin-autorecord: Wowza Streaming Engine™ module to record incoming...

Wowza Streaming Engine™ module to record incoming live streams using application StreamRecorder parameters.

I wrote an additional code in the middle to set my own parameters.
( ModuleAutoRecord.java Between 81 and 83 lines in the original file)

	recordParams = new StreamRecorderParameters(appInstance);
	recordParams.fileFormat = IStreamRecorderConstants.FORMAT_MP4;
	recordParams.fileTemplate = "${SourceStreamName}_${SegmentTime}_${SegmentNumber}";
	recordParams.outputPath = "D:/wowza/content/"+"${SourceStreamName}";
	File folder = new File(recordParams.outputPath);
	if(!folder.exists()) {
		folder.mkdirs();
	}
	recordParams.segmentationType = IStreamRecorderConstants.SEGMENT_BY_DURATION;
	recordParams.segmentDuration = 60000;

After extracting the module into a jar file and adding it to the system, the system was re-run to verify that the recorder was working.

INFO server comment - StreamRecorder[live/definst] recordStream: action:startRecordingSegmentByDuration stream:myStream1.stream format:mp4 versioning:version outputFile:myStream1.stream.mp4 outputPath:D:/wowza/content/null startOnKeyFrame:true moveFirstVideoFrameToZero:true splitOnTcDiscontinuity:false backBufferTime:0 timeScale:90000 recordData:false segmentDuration:60000 segmentSize:10485760 segmentSchedule:0 * * * * * defaultAudioSearchPosition: true skipKeyFrameUntilAudioTimeout: 10000 notifyListener: null fileTemplate:${SourceStreamName}${SegmentTime}${SegmentNumber} fileVersionDelegate:StreamRecorderFileVersionDelegate
INFO server comment - RTPMediaCaster.Reconnector[508999822:live/definst:myStream1.stream]: done: 1

As you know from the log above, other parameters are set normally, but you can see that the file path part contains null.
I thought nameStr was a unique name for streaming, but it wasn’t. I want to save files by setting different paths for each stream, but I don’t know how to get my name for each stream when I use an auto recorder!
So ultimately, what I’m curious about is finding out each name of the streaming when using an automatic recorder.
Before running the startRecoding function in the code above, is there a way to find out streamName?
I’d appreciate your help.

ps. When streaming starts, receiving stream names from the onPublish method in the StreamListener class works very well.

6 posts - 3 participants