Wowza Community

Stream name already in use

Hi!

Wowza Media Server 3.5.2, Linux Debian

I use Transcoder AddOn to transcode h.264/G.711 to h.264/ACC streams. Transcoder has ~40 incoming streams. It works for some time (10-15 minutes) then memory starts leaking. In wowzamediaserver_error.log there are several records:

WARN server comment 2013-06-26 17:39:17 - - - - - 2332.832 - - - - - - - - Publisher.publish: Stream name already in use: camera_00306F843360_code

WARN server comment 2013-06-26 17:39:49 - - - - - 2365.26 - - - - - - - - Publisher.publish: Stream name already in use: camera_00306F8427C0_code

WARN server comment 2013-06-26 17:40:31 - - - - - 2407.315 - - - - - - - - Publisher.publish: Stream name already in use: camera_00306F843360_code

WARN server comment 2013-06-26 18:14:10 - - - - - 4426.142 - - - - - - - - Publisher.publish: Stream name already in use: 474_20130625132401828_code

Stream name “*_code” is for transcoded stream.

I think that when incoming stream with the same name reconnects Transcoder it can not close previous stream. Is it possible to purge previous stream right after it disconnects from Transcoder with minimum timeout?

Is Transcoder AddOn the one who logs “Publisher.publish: Stream name already in use…” messages?

Is it possible you are allowing the same stream name to be published? There is a module to prevent that from happening here:

https://www.wowza.com/docs/how-to-block-a-duplicate-publish-stream

Or is the MediaCaster stream being reset before this happens? Do you have the MediaCaster Monitor enabled? If that is the case, can you upgrade to Wowza 3.6.2? There were some Transcoder changes. There is 3x to 3.6.2 patch here on Production Build page

Richard

“NetStream.Publish.Denied” is a notification sent to the RTMP encoder, it is not logged in Wowza. That module does write to the log just before sending that notificaiton:

getLogger().info("ModuleBlockDuplicateStreamNames.publish["+appInstance.getContextStr()+"]: Stream name is already in use: "+streamName);

What do you mean by “memory leak”? Transcoding uses a lot of cpu and memory. Take a look at these Transcoder benchmark tests for comparison, to see what is realistic for your setup

Remember that you have to leave room for playback. It is common to use Live Repeater (origin/edge) configuration with the Transcoder, where the transcoding is done on the origin and the edge(s) handle playback clients. This leaves more room on the origin for transcoding.

Richard

Are you only doing RTMP streaming? If so, remove the cupertinostreamingpacketizer, you don’t need it.

Otherwise, try IMediaStream.setLiveStreamPacketizer("") in the IMediaStreamActionNotify.onPublish() handler to turn off packetizing for a stream, if you can identify it.

Richard

Take a look at this example, this might help:

https://www.wowza.com/docs/how-to-use-imediastreamactionnotify2-to-monitor-live-streams-modulestreamwatchdog

There is a package that delays a stream too which you might be able to do something with, but try the above first.

Richard

Is it possible you are allowing the same stream name to be published?

Yes. I have several bad incoming streams that connects/disconnects Transcoder 2-3 times a second.

Do you have the MediaCaster Monitor enabled?

I am sorry. I did not mention that streams are RTMP! So there are no MediaCaster Monitor.

If that is the case, can you upgrade to Wowza 3.6.2?

There is a module to prevent that from happening here:

http://www.wowza.com/forums/content…publish-stream

I upgraded to Wowza 3.6.2 and switched on ModuleBlockDuplicateStreamNames module.

Now wowzamediaserver_error.log has messages:

WARN server comment 2013-06-27 12:36:06 - - - - - 1866.231 - - - - - - - - Publisher.publish: Stream name already in use: 438_20130529144051363_code

And wowzamediaserver_access.log has messages:

2013-06-27 12:36:54 MSK comment server INFO 200 - ModuleBlockDuplicateStreamNames.releaseStream[rtp-live/definst]: Stream name is already in use: 159_20130123160602450 - - - 1914.667

I notice that stream names are not coincide in logs…

But memory is still leaking!!! And I can see blocked stream “159_20130123160602450” with Flash RTMP Player example. Does ModuleBlockDuplicateStreamNames work? Is it possible that ModuleBlockDuplicateStreamNames is missing some streams?

I set up ModuleBlockDuplicateStreamNames module like in the article

https://www.wowza.com/docs/how-to-block-a-duplicate-publish-stream

But I could not see “NetStream.Publish.Denied” messages in log.

Today “Stream name is already in use” messages disappeared from logs and memory stopped leaking!!! I guess that these two events are connected…

The problem was in unstable incoming stream which reconnected transcoder two times a second. Can the leak be in stream create/destroy functions? I’ll have to do more profiling…

When I switch off cupertinostreamingpacketizer memory stops leaking with unstable stream.

With cupertinostreamingpacketizer:

Without cupertinostreamingpacketizer:

Richard, are there special conditions to run cupertinostreamingpacketizer? Is it possible to block unstable RTMP stream from being processed by cupertinostreamingpacketizer?

Otherwise, try IMediaStream.setLiveStreamPacketizer("") in the IMediaStreamActionNotify.onPublish() handler to turn off packetizing for a stream, if you can identify it.

I do not understand why ModuleBlockDuplicateStreamNames doesn’t work? Unstable stream connects WowzaMediaServer with the same name!

the IMediaStreamActionNotify.onPublish() handler

Richard,

How can I delay each incoming stream from publishing for 5 - 10 seconds? This time is enough to filter high-frequency connect/disconnect events. Unstable stream will never be published!

Starting frames from delayed stream can be skipped.