Wowza Community

Empty stream params in onStreamCreate


I have a task to read streams parameters, I am newbie in this WOWZA SDK

So, I’ve created simple module, where I’ve implenebted

public void onStreamCreate(IMediaStream stream)
public void onStreamDestroy(IMediaStream stream)

I am just printing out this to console

		private String getStreamString(IMediaStream stream) {
		StringBuffer stringInfo = new StringBuffer();
		stringInfo.append("Stream ID: ").append(stream.getUniqueStreamIdStr());
		stringInfo.append("; stream start time: ").append(System.currentTimeMillis());
		stringInfo.append("; video codec: ").append(stream.getPublishVideoCodecId());
		stringInfo.append("; audio codec: ").append(stream.getPublishAudioCodecId());
		stringInfo.append("; video size (width and height): ").append(stream.getVideoSize());
		stringInfo.append("; FPS ").append(stream.getReceiveVideoFPS());
		stringInfo.append(";  total bitrate (bits per second): ").append(stream.getPublishBitrateVideo() + stream.getPublishBitrateAudio());
		stringInfo.append("; birtrate audio: ").append(stream.getPublishBitrateAudio());
		stringInfo.append("; birtrate video: ").append(stream.getPublishBitrateVideo());
		stringInfo.append("; FPS ").append(stream.getReceiveVideoFPS()); 
		return stringInfo.toString();

But I can see only stream id and start time, all other parameters are -1, or 0:

Stream ID: 1166069816_1; stream start time: 1469486854596; video codec: -1; audio codec: -1; video size (width and height): 0; FPS -1;  total bitrate (bits per second): 0; bitrate audio: 0; bitrate video: 0; FPS -1

When i press stop button, i can see logs from onStreamDestroy method, with same id, but again with empty params

Using version is 4.5.0

Please help me how to see all that fields that I want?

I do not understand why that parameters are empty?


Are you trying to detect the parameters for an incoming RTMP stream? If so, then you would need to make sure that you have the correct event listeners in place for your onStreamCreate and onStreamDestroy methods. You can do this by implementing IMediaStreamActionNotify3 interface in your module.