Results 1 to 4 of 4

Thread: Limit Duration Live Streams

  1. #1

    Default Limit Duration Live Streams

    I would like to limit the duration on live streams to 10 minutes. Has anyone done this successfully?

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

    Default

    You could probably do something tricky using a Stream class stream in IMediaStreamNameAliasProvider2.onResolvePlayAlias()

    http://www.wowza.com/forums/content....der2-interface

    If you play "myStream" in RTMP client:
    Server: rtmp://[wowza-address]:1935/live
    Stream: myStreamAlias

    Try this in ResolvePlayAlias (the one that include IClient):
    public String resolvePlayAlias(IApplicationInstance appInstance,
    			String name, IClient client) {
    		getLogger().info("Resolve Play Flash: " + name);
    		
    		if (name.equalsIgnoreCase("myStreamAlias"))
    		{
    		Stream stream1 = Stream.createInstance(appInstance, "Stream1");
    		stream1.setRepeat(false);
    		stream1.play("myStream", -2, 10, true);
    		stream1.play("mp4:sample.mp4", 0, 5, false); // you have to switch to a static file for it to work.
    		name="Stream1";
    		}
    		
    		return name;
    	}
    Richard
    Last edited by rrlanham; 02-06-2013 at 04:47 PM.

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

    Default

    I tested, made a few changes. It works as above test with Flash RTMP clients. You would have to add same to other resolvePlayAlias overloads in that interface.

    Note that you will have to create a new Stream class stream for each request. The example is set to 10 seconds, until it changes to sample.mp4, which was necessary in my test. Replace sample.mp4 with what you want to

    Richard

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

    Default

    To be clear, the example creates a stream named "Stream1" that is will play for 10 seconds, or whatever you set it to. In your application, you should create a different stream name for each client, they can't all play Stream1. You will have to devise some scheme, you could just increment a suffix, create that stream and return it to the client

    Richard

Similar Threads

  1. Limit the stream play duration in RTSP
    By er.kmanoj in forum On-Demand Streaming
    Replies: 2
    Last Post: 05-20-2014, 11:33 AM
  2. Duration for Live HLS Streams
    By tofferf in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 11-06-2012, 07:53 AM
  3. Simple way to limit live stream duration
    By iCatcherCCTV in forum Live Streaming and Encoder Discussion
    Replies: 3
    Last Post: 11-10-2011, 06:54 AM
  4. DVR Chunk Target Duration / Chunk Limit
    By carlosleite in forum AddOn: Wowza nDVR
    Replies: 1
    Last Post: 10-19-2011, 01:30 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
  •