# IMediaStream stream.getName is empty. How come?

**URL:** https://community.wowza.com/t/imediastream-stream-getname-is-empty-how-come/35423
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [July 5, 2011, 12:48pm UTC](https://community.wowza.com/t/imediastream-stream-getname-is-empty-how-come/35423 "2011-07-05T12:48:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Daniel\_Mahoney](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@Daniel\_Mahoney](https://community.wowza.com/u/Daniel_Mahoney)
#### Post date: [July 5, 2011, 12:48pm UTC](https://community.wowza.com/t/imediastream-stream-getname-is-empty-how-come/35423/1 "2011-07-05T12:48:31Z")

</div>

After getting sidetracked for the last couple months trying to do things with Flash Media Server, I am finally back to using the proper tool for the job - Wowza.

I need an application that will both serve up a live stream and record it to an archive file, but without requiring the user to click the “Record” button in FMLE. Should be a really simple task. I’ve done this on a Wowza edge server, but am now trying to do so on an origin server.

In my onStreamCreate function I’ve got:

```
public void onStreamCreate(IMediaStream stream) {

String streamName = stream.getName();

getLogger().info("onStreamCreate: stream name is " + streamName);

}
```

When I start my FMLE encoding, my log window shows:

```
INFO server comment - onStreamCreate: stream name is
```

I’m not sure why I’m not seeing the stream name. FMLE is pushing it’s stream to rtmp://10.1.10.26/cstv with a stream name of dan. stream.getSrc() returns 1, and stream.getContextStr() returns cstv/_definst_

Any ideass why the stream name is blank?

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 5, 2011, 6:53pm UTC](https://community.wowza.com/t/imediastream-stream-getname-is-empty-how-come/35423/2 "2011-07-05T18:53:43Z")

</div>

onStreamCreate is too soon for stream name. Use StreamType liverepeater-origin-record.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 5, 2011, 7:54pm UTC](https://community.wowza.com/t/imediastream-stream-getname-is-empty-how-come/35423/3 "2011-07-05T19:54:15Z")

</div>

For moving/renaming, take a look at :

[https://www.wowza.com/docs/how-to-move-recordings-from-live-streams](https://www.wowza.com/docs/how-to-move-recordings-from-live-streams)

Or for finer control:

[https://www.wowza.com/docs/how-to-use-imediawriteractionnotify-to-programmatically-move-and-rename-recordings-of-live-streams](https://www.wowza.com/docs/how-to-use-imediawriteractionnotify-to-programmatically-move-and-rename-recordings-of-live-streams)

Richard

---

<div class="post-metadata">

### Author: ![Daniel\_Mahoney](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@Daniel\_Mahoney](https://community.wowza.com/u/Daniel_Mahoney)
#### Post date: [July 5, 2011, 1:14pm UTC](https://community.wowza.com/t/imediastream-stream-getname-is-empty-how-come/35423/4 "2011-07-05T13:14:58Z")

</div>

Excellent! Thanks for that suggestion. That does indeed capture the stream just like I need.

All I need to do now is manipulate the file name the stream gets stored to. I recall having done that before in a StreamListener, so I’ll take a look at how I did that before.

I’ve got to say, doing this stuff purely in Wowza is so much simpler and straightforward than trying to do it with FMS.
