Results 1 to 5 of 5

Thread: PushPublish LLNW reconnect

  1. #1

    Default PushPublish LLNW reconnect

    I'm setting up a dynamic turn on/off for pushing streams to LLNW, so the client can avoid wowza server restarts and encoder restarts.

    I have a pushpublisher set up to push streams to a primary and backup llnw destination, works as expected:

    INFO server comment - PushPublisher.sessionOpened[rtmp://ingest01.pri.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]:
    INFO server comment - PushPublisher.resetConnection[rtmp://ingest01.pri.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]: com.wowza.wms.plugin.pushpublish.protocol.rtmp.PushPublisherRTMPSession@17b4239f
    INFO server comment - PushPublisher.sessionClosed[rtmp://ingest01.pri.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]
    INFO server comment - PushPublisher.sessionOpened[rtmp://ingest01.pri.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]:
    INFO server comment - PushPublisher.sessionOpened[rtmp://ingest01.bak.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]:
    INFO server comment - PushPublisher.resetConnection[rtmp://ingest01.bak.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]: com.wowza.wms.plugin.pushpublish.protocol.rtmp.PushPublisherRTMPSession@4a523b16
    INFO server comment - PushPublisher.sessionClosed[rtmp://ingest01.bak.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]
    INFO server comment - PushPublisher.sessionOpened[rtmp://ingest01.bak.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]:

    Calling disconnect() on PushPublisherRTMP works as expected:

    INFO server comment - ModulePushPublish> StreamNotify.stopPublishers
    INFO server comment - PushPublisher.disconnect[rtmp://ingest01.pri.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]: com.wowza.wms.plugin.pushpublish.protocol.rtmp.PushPublisherRTMPSession@51e1c25d
    INFO server comment - PushPublisher.sessionClosed[rtmp://ingest01.pri.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]
    INFO server comment - PushPublisher.disconnect[rtmp://ingest01.bak.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]: com.wowza.wms.plugin.pushpublish.protocol.rtmp.PushPublisherRTMPSession@10144efe
    INFO server comment - PushPublisher.sessionClosed[rtmp://ingest01.bak.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]

    But calling connect() on the same objects (to do a reconnection) doesnt.

    INFO server comment - ModulePushPublish> StreamNotify.startPublishers
    INFO server comment - ModulePushPublish> StreamNotify.startPublisher test.sdp / 2
    INFO server comment - ModulePushPublish> connect 0
    INFO server comment - ModulePushPublish> connect 1

    This is just the info I have printed for my purposes,

    shutdown after calling connect() on publishers which have been disconnected:

    INFO stream unpublish test.sdp -
    INFO server comment - PushPublisher.disconnect[rtmp://ingest01.pri.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]: null
    INFO server comment - PushPublisher.disconnect[rtmp://ingest01.bak.xxx.fmspush.llnw.net:1935/xxx/_definst_/test.sdp]: null
    INFO stream destroy test.sdp -
    INFO session disconnect 541353355 -

    So, it looses the session/auth credentials with disconnect(), but doesn't restore them with connect(). Is there a way to avoid this, or maybe a way to re-authenticate with the existing PushPublisherRTMP instance? What would be the correct way to reconnect the PushPublisherRTMP and continue pushing the stream to LLNW?

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Try implementing IPushPublisherRTMPNotify and use onConnectFailure. There is an example here:

    http://www.wowza.com/forums/showthread.php?13935#8

    Richard

  3. #3

    Default

    Quote Originally Posted by rrlanham View Post
    Try implementing IPushPublisherRTMPNotify and use onConnectFailure. There is an example here:

    http://www.wowza.com/forums/showthread.php?13935#8

    Richard
    I don't think you properly understand. I'm trying to close the connection with disconnect() and then reopen with connect(). I already know the session gets destroyed during this, but it doesn't get recreated on calling connect(). While onConnectFailure() is useful for me in a different scenario, it doesn't help me with this one. It's not a blocking issue anyway, I just re-created the PushPublisherRTMP objects (new instance) instead of using the existing ones.

    For the type of application I'm working on, I have to keep track of IMediaStream objects even when I don't have an active PushPublisherRTMP object for them (starting and stopping streams). We seem to be having some issues (currently pinpointing them) with this approach. I suspect I have problems with using the PushPublisherRTMP for a "stale" IMediaStream object (it is "stale" for about 20 hours, before the push to LLNW is started again on the same IMediaStream). Regularely it seems the Wowza server needs to be restarted, as the LLNW stream gets jagged/flawed if we don't. There is no option to restart the encoder, so it would create a new stream/IMediaStream object onPublish.

    So I guess, my question would be, is there a way to programatically monitor stream quality, to somehow figure out the source of the jaggedness, or b) to close the pushed IMediaStream from Wowza side and hopefully get a re-connect from the encoder (that's basically what restarting the wowza server itself does). I'm guessing we could shutdown the app via JMX to recreate everything?

  4. #4

    Default

    Hi Tit,

    Are you calling these PushPublisher.resetConnection in your first post, or is that automated?

    Have you tried calling that method after a disconnect?
    Have you tried re-running all the code that sets up the publisher, except for: PushPublisherRTMP publisher = new PushPublisherRTMP();?

    Note, there is also "isReconnectorRunning()", and "setReconnectWaitTime()". This implies to me the PushPublisher should automatically reconnect. But, that might just be for the internal use for the various stream quality monitors in the API. But, you might try playing with the wait time.

  5. #5

    Default

    Hey,

    I'm not calling resetConnection. I'm was calling disconnect() and then connect(). Shouldn't resetConnection() be called in connect()? Since I recreate the PushPublisherRTMP objects now, that is not an issue anymore.

    I don't think calling disconnect() should trigger a reconnect if I play with isReconnectorRunning/setReconnectWaitTime (which IIRC are marked for internal use anyway).
    The question should be simple - when is the session created? If it's created in connect(), why isn't it being recreated after disconnect() with calling connect() again.

    My remaining issue is using this with long running streams, when I activate the push on a cached IMediaStream object after several hours without an active push to LLNW. I don't know exactly where this goes wrong, but it was always necessary to restart WMS to assure that the stream would start to get pushed correctly to LLNW.

Similar Threads

  1. MediaCaster Disconnects After Reconnect
    By Moresheth in forum Server-side Modules and Code Samples Discussion
    Replies: 4
    Last Post: 08-16-2013, 04:24 PM
  2. WOWZ reconnect
    By robstreamhosting in forum General Forum
    Replies: 7
    Last Post: 05-17-2013, 07:54 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
  •