Results 1 to 2 of 2

Thread: Chunk/segment size per stream?

  1. Question Chunk/segment size per stream?

    Is it possible to set the chunk/segment size per stream (instead of per application in the Application.xml)? I've looked into the onLiveStreamPacketizerInit(ILiveStreamPacketizer liveStreamPacketizer, String streamName) method, but there's no obvious property or method in the ILiveStreamPacketizer for that.

  2. #2

    Default

    You can do it, probably not as you might expect

    	public void onAppStart(IApplicationInstance appInstance) {
    		
    		appInstance.addLiveStreamPacketizerListener(new LiveActionNotify(appInstance));
    		
    	}
    	
    	class LiveActionNotify implements ILiveStreamPacketizerActionNotify
    	{
    		private IApplicationInstance appInstance = null;
    
    		public LiveActionNotify(IApplicationInstance appInstance)
    		{
    			this.appInstance = appInstance;
    		}
    
    		public void onLiveStreamPacketizerCreate(ILiveStreamPacketizer liveStreamPacketizer, String streamName)
    		{
    			while (true)
    			{
    				if (!(liveStreamPacketizer instanceof LiveStreamPacketizerCupertino))
    					break;
    				LiveStreamPacketizerCupertino cupertinoPacketizer = (LiveStreamPacketizerCupertino)liveStreamPacketizer;
    
    
    				if (streamName.equals("Stream1") )
    					{
    					cupertinoPacketizer.getProperties().setProperty("cupertinoChunkDurationTarget", 2000);
    					}
    		
    				if (streamName.equals("Stream2") )
    					{
    					cupertinoPacketizer.getProperties().setProperty("cupertinoChunkDurationTarget", 10000);
    					}
    				if (streamName.equals("Stream3") )
    					{
    					cupertinoPacketizer.getProperties().setProperty("cupertinoChunkDurationTarget", 6000);
    					}
    				break;
    			}
    		
    
    		}
    
    		public void onLiveStreamPacketizerDestroy(ILiveStreamPacketizer liveStreamPacketizer)
    		{
    		}
    
    		public void onLiveStreamPacketizerInit(ILiveStreamPacketizer liveStreamPacketizer, String streamName)
    		{
    		}
    	}
    I have tested it and I get

    INFO stream publish Stream1 -
    INFO stream create - -
    INFO stream publish Stream2 -
    INFO stream create - -
    INFO stream publish Stream3 -
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream2]: chunkDurationTarget: 10000
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream3]: chunkDurationTarget: 6000
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream1]: chunkDurationTarget: 2000
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream3]: audioGroupCount: 3
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream2]: audioGroupCount: 3
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream3]: playlistChunkCount:3
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream1]: audioGroupCount: 3
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream2]: playlistChunkCount:3
    INFO server comment - LiveStreamPacketizerCupertino.init[live/_definst_/Stream1]: playlistChunkCount:3
    INFO server comment - MediaStreamMap.getLiveStreamPacketizer[live/_definst_/Stream2]: Create live stream packetizer: cupertinostreamingpacketizer:Stream2
    INFO server comment - MediaStreamMap.getLiveStreamPacketizer[live/_definst_/Stream1]: Create live stream packetizer: cupertinostreamingpacketizer:Stream1
    INFO server comment - MediaStreamMap.getLiveStreamPacketizer[live/_definst_/Stream3]: Create live stream packetizer: cupertinostreamingpacketizer:Stream3
    So it does appear to work, however certainly something at present which is not tested.

    Andrew.

Similar Threads

  1. what is default chunk size for HLS?
    By dirtystar in forum General Forum
    Replies: 3
    Last Post: 03-25-2014, 04:49 AM
  2. Read chunk size and count programmatically
    By karelboek in forum Live Streaming and Encoder Discussion
    Replies: 2
    Last Post: 10-12-2013, 12:40 PM
  3. Cupertino chunk size
    By myumyu.takoyaki in forum Video On Demand Streaming Discussion
    Replies: 1
    Last Post: 04-09-2013, 11:46 PM
  4. video on demand chunk size
    By lewyan13 in forum Video On Demand Streaming Discussion
    Replies: 4
    Last Post: 12-10-2012, 05:53 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
  •