Page 1 of 3 123 LastLast
Results 1 to 10 of 28

Thread: Set window duration per stream

  1. #1

    Default Set window duration per stream

    Is it possible to set the window duration per stream in a Wowza Module? For instance in the onStreamCreate method.

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

    Default

    I think so:

    http://www.wowza.com/forums/content....-Recording-API

    // To set the window duration
    DvrApplicationContext ctx = appInstance.getDvrApplicationContext();
    ctx.setWindowDuration(300);
    Richard

  3. #3

    Default

    Quote Originally Posted by rrlanham View Post
    I think so:

    http://www.wowza.com/forums/content....-Recording-API

    // To set the window duration
    DvrApplicationContext ctx = appInstance.getDvrApplicationContext();
    ctx.setWindowDuration(300);
    Richard
    But that's per application instance not per stream? Or can I set the window duration with this method in onStreamCreate method so that it only affects the new stream and not currently running streams?

  4. #4

    Default

    Yes you're right that will do it for all apps.
    It turns out there is a problem with this. I fixed it and it should be in the latest patch here: http://www.wowza.com/downloads/Wowza...0.4-patch2.zip

    You would do something like this:
    package com.wowza.wms.plugin.test.dvr.api;
    
    import java.util.*;
    
    import com.wowza.wms.application.*;
    import com.wowza.wms.dvr.*;
    import com.wowza.wms.module.ModuleBase;
    import com.wowza.wms.stream.IMediaStream;
    import com.wowza.wms.stream.livedvr.*;
    
    public class MyModule extends ModuleBase implements IDvrStreamManagerActionNotify {
        private static final String CLASSNAME = "MyModule ";
    
        
        public MyModule () {
        }
    
    
        public void onAppStart(IApplicationInstance appInstance) {
            appInstance.addDvrStreamManagerListener(this);       
        }
    
        public void onAppStop(IApplicationInstance appInstance) {
            appInstance.removeDvrStreamManagerListener(this);
        }
    
    
        public void onDvrStreamManagerCreate(IDvrStreamManager dvrManager) {
            WMSProperties props = dvrManager.getProperties();
    
            props.put(IDvrConstants.PROPERTY_WINDOW_DURATION, 300);
            //props.put(IDvrConstants.PROPERTY_ARCHIVE_STRATEGY, IDvrConstants.ARCHIVE_STRATEGY_VERSION);
            //props.put(IDvrConstants.PROPERTY_STORAGE_DIRECTORY, "c:/temp/");
        }
    
        public void onDvrStreamManagerInit(IDvrStreamManager dvrManager) {
            WMSProperties props = dvrManager.getProperties();
            System.out.printf("%s.onDvrStreamManagerInit winDur:%s archive:%s dir:%s\n", CLASSNAME, dvrManager.getDvrStorageWindowSeconds(), dvrManager.getArchiveStrategy(), dvrManager.getDvrStorageDir()); 
    
        }
    
        public void onDvrStreamManagerDestroy(IDvrStreamManager dvrManager) {
        }
    
    }

  5. #5

    Default

    But this fix will still only work per application instance and not per stream right? Are there any plans to implement this on a per stream basis? Seems like a more logical approach to me .

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

    Default

    The listener is added per application, but this should be per stream.

    Richard

  7. #7

    Default

    But the example ScottKell gives is also per app instance? Can you instantiate a dvrManager per stream instead of per application instance?

    BTW, where is the updated API documentation always included in the released patches?

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

    Default

    The only thing that is per app instance is registering the listener. Then it will run per stream.

    The javadocs are updated every major release not per patch Meanwhile new methods are documented ad-hoc in forum threads or in articles.

    Richard

  9. #9

    Default

    Quote Originally Posted by rrlanham View Post
    The only thing that is per app instance is registering the listener. Then it will run per stream.
    So the onDvrStreamManagerCreate is called when a stream is created, not when the DvrManager itself is created?

    The name of the method (onDvrStreamManagerCreate) is a bit ambiguous. It could mean that it's called when the DvrManager itself is created or that it's called when a stream is created. "onDvrStreamCreate" would be clearer, another more clear (but uglier ) method name would be "onDvrStreamManagerStreamCreate" (also more in line with other method names).

    You could also implement it like some other listeners in Wowza; with an inline private listener class. Then the methods could just be called "onInit" or "onStreamCreate"; but maybe the longer names are better/more self explanatory (and it's also nice to be able to add listener methods to the application module itself).

    I hope you appreciate the feedback .

    The javadocs are updated every major release not per patch Meanwhile new methods are documented ad-hoc in forum threads or in articles.

    Richard
    I guess I have to check this forum and the nDVR articles on a regular basis then. That's the "price" I have to pay to work with beta technology :P. At least it feels like I am working with the very latest Wowza technology .

    Meinaart

  10. #10

    Default

    I really like this forum and the "new" articles section. But I think Wowza would also benefit from a better online API documentation. A bit more in line with PHP's documentation for example. On the PHP documentation site people can give comments on specific methods/functions and there are also a lot more examples. It's a bit more "live" and works really well because other users can give examples on how to use specific functions (separated from the rest of the official documentation). This is especially useful for less used functionality.

    The articles section is a big improvement already because now certain information is not scattered around the forum. But I think it can be even better . Especially when you can link forum threads and articles to the API documentation.

Page 1 of 3 123 LastLast

Similar Threads

  1. nDVR window duration
    By Lelik1985 in forum General Forum
    Replies: 1
    Last Post: 08-08-2014, 02:53 AM
  2. Set duration to RTMP MP3 Streaming
    By chf2013 in forum Server-side Modules and Code Samples Discussion
    Replies: 3
    Last Post: 06-19-2013, 06:22 PM
  3. Set start and duration to rtmp is indistinct
    By Epoks_ in forum Server-side Modules and Code Samples Discussion
    Replies: 0
    Last Post: 01-24-2013, 08:08 AM
  4. NDVR with nonzero Window Duration
    By ozgurdeniz in forum AddOn: Wowza nDVR
    Replies: 3
    Last Post: 05-16-2012, 05:12 AM
  5. How To set Chunk Duration(segments) for a non-live streaming
    By arun.kumar@techjini.com in forum Server Administration Discussion
    Replies: 1
    Last Post: 12-16-2011, 07:38 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
  •