Results 1 to 5 of 5

Thread: MediaCaster Disconnects After Reconnect

  1. #1

    Default MediaCaster Disconnects After Reconnect

    This is a bit of a long shot, but I was going to check if anyone can help me.

    In our server architecture, we have servers that take the broadcaster streams (ingest server), and servers that handle viewer streams (origin server). For handling load, I'm creating a MediaCaster to send the streams between them through the server API. This is how Wowza does the liverepeater by default.

    In my resolveStreamAlias, I am returning the connection to the other server. I'm using the wowz: protocol, but I also tried the rtmp: with the same results.

    Here's the basics of it, with some unrelated code removed.
    	public String resolveStreamAlias(IApplicationInstance appInstance, String name, IMediaCaster mediaCaster) {
    		return "wowz://" + hostname + "/" + sourceAppName + "/" + noSource(name);
    It works, for the most part, especially right after restarting the server, with the first time you stream with that connection. But, after reconnecting the mediacaster, it works for a minute or so, then the stream is shutdown and disconnected.

    Here's the lines in the log when it happens:
    2013-08-15	19:04:47	UTC	comment	server	INFO	200	-	LiveMediaStreamReceiver.shutdown: [Lcom.wowza.wms.mediacaster.wowza.LiveMediaStreamURL;@2ec7ecd5	-	-	-	408.166	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	-	--
    2013-08-15	19:04:47	UTC	comment	server	INFO	200	-	LiveMediaStreamReceiver.disconnect: (SOCKET, R:, L: /, S:	-	-	-	408.166	-	-	-	-	-	-	--
    I can't figure out what the problem is, but works fine for a long time if you never disconnect. I'm also not sure if it's a problem with the origin server that viewers connect to, or the ingest server that broadcasters connect to.

    There's a lot more code to the app, which I can provide better details on, if that would help.


  2. #2
    Join Date
    Dec 2007



    I would test with simple configuration, using .stream files instead of alias api.


  3. #3


    On this, I figured out that it was getting shut down by the server MediaCaster setting for "KeepAliveTime". It was set to 1 minute, but I changed it to 24 hours:

    			<Description>Live Stream Repeater</Description>

  4. #4
    Join Date
    Dec 2007


    Great. Thanks for the update


  5. #5


    Quote Originally Posted by Moresheth View Post
    On this, I figured out that it was getting shut down by the server MediaCaster setting for "KeepAliveTime". It was set to 1 minute, but I changed it to 24 hours:

    This sounds like a pretty heavy handed way of dealing with the problem and cold lead to other problems.

    How are you starting your mediaCaster? This will determine it's lifecycle and when it shuts down.

    There are 2 basic ways to start a mediaCaster.

    1) Dynamically using liverepeater-edge stream type. When an rtmp or rtsp player connects to the stream and it is not already running, the mediaCaster will be started automatically. Other Wowza servers are considered as rtmp players. The mediacaster keeps track of the number of players connected to the stream and as long as at least one rtmp or rtsp player is connected, the mediaCaster will stay running. Once there have been no players connected for a period of time then it will shut down automatically. Http players will not trigger a mediaCaster startup unless the related *repeater LiveStreamPacketizer is set and then in this case, it will start a separate mediaCaster for the packetizer. This will also shut down when all http players disconnect. The origin server is the one that does the packetizing and the edge just repeats.

    2) Manually using live stream type and Stream Manager, StartupStreams.xml or api methods. MediaCasters started this way do not track the players but instead, set a lock count on the mediaCaster so that it stays connected. They must be shut down manually using either the Stream Manager or api methods. Http Streams will only work if the related *packetizer LiveStreamPacketizer is set. In this case, the server will packetize the http stream. See the appInstance.StartMediaCasterStream & appInstance.stopMediaCasterStream methods in the api documentation.

    You would use the first method on edges where the stream does not need to be running all of the time and reduces network & server load.
    You use the second method where you need the mediaCaster to remain connected. eg. recording, transcoding or if the origin is not packetizing the http stream.

    You can also have a combination of the two. You may need the stream persistent to record or transcode but then want the http players to use the origin packetizers. In this case, you would set the stream type to live and start the mediaCaster manually. You set the *repeater LiveStreamPacketizers on the edge with the *packetizer LiveStreamPacketizers on the origin. When a http player connects, it will start a http mediaCaster to get the packetized stream from the origin. There should not be a *packetizer LiveStreamPacketizer set on the edge for the http stream type.

    Last edited by roger_l; 08-16-2013 at 04:27 PM.

Similar Threads

  1. Replies: 3
    Last Post: 05-16-2013, 07:01 AM
  2. Stopping a mediacaster stream when the last client disconnects.
    By sgebjn in forum Server-side Modules and Code Samples Discussion
    Replies: 0
    Last Post: 02-20-2013, 07:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts