Wowza Community

Difference between IMediaStream and Stream


I have confusion about IMediaStream that create in standard broadcasting and Stream create from Wowza:

Stream stream = Stream.createInstance(appInstance, streamName);

I use Stream in Playlist but sometimes I can’t stop it.

After my Stream.stop() Stream is available yet but not exist in list of appInstance.getPublishStreamNames().

Which measure I must use? How object Stream livecycle in Wowza?




Try stream.close() to stop an Stream class stream.


Hi Carlo,

IMediaStream is the interface that is used to interact with all streams on the server. Each of the different stream types on the server implement the IMediaStream interface.

Stream ( is a server side created live stream that you can then insert other live or vod sources into. Internally, it has it’s own IMediaStream object available in stream.getPublisher().getStream();

If you create a Stream but never add any valid sources to it then using stream.close(); may not close it down properly because the underlying publisher thread would not have started running.

If you try to create another stream using the same name, it will fail because the stream name is still in use.

You can use the following method to shut down the stream completely.

// close the stream and wait for the publisher thread to end and destroy the publisher.
// get a reference to the publisher.  If the thread never started, the publisher will still exist so close the publisher.
Publisher publisher = stream.getPublisher();
if(publisher != null)


1 Like

Thanks a lot