# Empty stream params in onStreamCreate

**URL:** <https://community.wowza.com/t/empty-stream-params-in-onstreamcreate/47313>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [July 26, 2016, 1:16am UTC](https://community.wowza.com/t/empty-stream-params-in-onstreamcreate/47313 "2016-07-26T01:16:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evgeny\_Kislyy](https://avatars.discourse-cdn.com/v4/letter/e/13edae/32.png) [@Evgeny\_Kislyy](https://community.wowza.com/u/Evgeny_Kislyy)\
**Post date:** [July 26, 2016, 1:16am UTC](https://community.wowza.com/t/empty-stream-params-in-onstreamcreate/47313/1 "2016-07-26T01:16:30Z")

</div>

Hello!

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

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

```

I am just printing out this to console

```auto
		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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Michelle\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/michelle_b/32/394_2.png) [@Michelle\_B](https://community.wowza.com/u/Michelle_B)\
**Post date:** [August 12, 2016, 9:22am UTC](https://community.wowza.com/t/empty-stream-params-in-onstreamcreate/47313/2 "2016-08-12T09:22:21Z")

</div>

Hi,

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](https://www.wowza.com/docs/how-to-use-imediastreamactionnotify3-interface-to-listen-for-rtmp-stream-events-includes-codec-info%28includes-codec-info%29) interface in your module.

Michelle
