Results 1 to 6 of 6

Thread: How to completely remove a stream?

  1. #1

    Default How to completely remove a stream?

    Hi,

    I noticed something that may be a problem for us which I think is related to a stream not being completely removed.
    Here's the scenario:
    1. I have a channel with a stream created by the Stream class by using Stream.createInstance(thisAppInstance,"Stream1");
    2. This stream is being read by our CDN to be served to viewers.

    So far so good.
    What I've noticed is that after I supposedly destroyed that channel and try to create it again the following call didn't return null:
    IMediaStream mainStream = thisAppInstance.getStreams().getStream("Stream1");
    if (mainStream==null) returned false.
    Since on server startup I do get back null I'm assuming it is not being destroyed properly.
    What I attempt to do in order to destroy is the following:
    IMediaStream activePublisherStream = thisAppInstance.getStreams().getStream("Stream1");
    activePublisherStream.removeListener(playlistListener);
    activePublisherStream.close();

    My question is, what is the correct way for destorying the stream.

    Thanks,
    Jonathan

  2. #2

    Default

    You need to call close on the Stream class. You are calling close on the IMediaStream interface which will not properly close the stream.

    Charlie

  3. #3

    Default

    I'm sorry, I just reviewed my code again and I didn't write the code correctly.

    activePublisherStream is a Stream class instance which was created by

    Stream activePublisherStream;
    activePublisherStream = Stream.createInstance(thisAppInstance, "Stream1");

    Which when I want to destroy the channel I call:
    activePublisherStream.removeListener(playlistListener);
    activePublisherStream.close();

    Yet the following still hold:
    IMediaStream mainStream = thisAppInstance.getStreams().getStream("Stream1");
    if (mainStream==null) returned false.

    How is that possible?

    Thanks,
    Jonathan

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

    Default

    Jonathan,

    Probably because some Flash RTMP client is playing Stream1, which can be true even if Stream1 is not being published. Use IApplicationInstance.getPublishStreamNames

    List<String> published = client.getAppInstance().getPublishStreamNames();
    Iterator<String> iter = published.iterator();
    Richard

  5. #5

    Default

    Hi Richard,

    I understand, this was my hunch from the beginning.
    The flash player doesn't play the stream directly but via the CDN which will contiously try to play Stream1.

    So just to make sure, in terms of clean up for destroying and creating the Stream instance again, do I need to do anything regarding the CDN client like disconnecting it?

    Thanks,
    Jonathan

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

    Default

    Jonathan,

    It's a play stream, so it doesn't really matter. There is no bandwidth usage if it is not being published.

    Richard

Similar Threads

  1. Is it necessary to remove manually the IMediaStreamActionNotify from the stream?
    By wtoolbox in forum Wowza Streaming Server Java API
    Replies: 3
    Last Post: 10-08-2014, 02:22 AM
  2. completely bypass cache
    By bo-lee_f in forum On-Demand Streaming
    Replies: 4
    Last Post: 07-08-2014, 08:36 AM
  3. Newbie to Wowza... completely lost
    By jeffpgray in forum Live Streaming and Encoder Discussion
    Replies: 6
    Last Post: 09-19-2013, 03:16 PM

Posting Permissions

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