Results 1 to 1 of 1

Thread: LiveStreamRecord schedule is wrong

  1. #1

    Default LiveStreamRecord schedule is wrong

    Hi all,

    I am developing a live stream record project with using LiveStreamRecord module (http://www.wowza.com/forums/content.php?123) . I used my own file version delegate.
    My delegate rule is that split a hour to 6 part and give a name which contains previous 10 minutes and next 10 minutes.

    Part Of Hour	Segment Suffix	
    	1			00_10	
    	2			10_20 	
    	3			20_30	
    	4			30_40	
    	5			40_50	
    	6			50_00	

    So, if start time is 10:05 then file name must be 2014_01_21_10_00_10 and it must contains 5-minute recording
    if start time is 10:53 then file name must be 2014_01_21_10_50_00 and it must contains 7-minute recording

    I have done this scenario however i've got a problem like this, after recording for a hour 5 segment are ok , all has 10 minutes recording but 1 segment has 9 minutes 57 second.

    Configuration for record :
    http://tinypic.com/r/28mpao3/5


    And delegate class :

    PHP Code:
    public class MyDelegate implements ILiveStreamRecordFileVersionDelegate
    {
        public 
    String getFilename(ILiveStreamRecord recorder)
        {
            
    String name;
            try
            {
                
    WMSLoggerFactory.getLogger(null).info("\n\n>>>MyDelegate.getFilename: "+recorder.getBaseFilePath()+"\n\n");
                
    File file = new File(recorder.getBaseFilePath());
                
    String oldBasePath file.getParent();
                
    String oldName file.getName();
                
    String oldExt "";
             
                
    File destinationFolder = new FileoldBasePath oldName);
                if(!
    destinationFolder.isDirectory() && !destinationFolder.mkdir()) {
                    
    WMSLoggerFactory.getLogger(null).info("\n\n>>>Folder is failed to create\n\n ");
                    
                    return 
    null;
                }
                
    int oldExtIndex oldName.lastIndexOf(".");
                if (
    oldExtIndex >= 0)
                {
                    
    oldExt oldName.substring(oldExtIndex);
                    
    oldName oldName.substring(0oldExtIndex);
                }
                
                
    name oldBasePath+"/"+oldName+"_"+getName()+oldExt;
                
                
    file = new File(name);
                if (
    file.exists())
                {
                    
    file.delete();
                }
            }
            catch (
    Exception e)
            {
                
    WMSLoggerFactory.getLogger(null).info("MyDelegate.getFilename: "+e.toString());
                
    // return a temp filename
                
    name "temp"+getName()+".tmp";
            }
            return 
    name
        }
        public 
    String getName(){
            
    String returnStr "";
            
    Date now = new Date();
            
    DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd_HH_mm");
            
    String date dateFormat.format(now);
             
            
            
            
            
    int lastChar2 = new Integer(date.substring(date.length()-2,date.length()-1));
            
            
    int start lastChar2*10;
            
    int end = ((lastChar2+1)%6)*10;
            if(
    end == 0){
                
                
    returnStr date.substring(0,date.length()-3)+"_"+start+"_00";
            }else{
                
    returnStr date.substring(0,date.length()-3)+"_"+start+"_"+end;
            }
            return 
    returnStr;
        }

    Last edited by tujixx; 01-22-2014 at 05:47 AM.

Similar Threads

  1. problems using schedule
    By pqangel in forum Wowza Streaming Server Java API
    Replies: 11
    Last Post: 10-27-2014, 05:20 AM
  2. How to load smil schedule
    By ao_tony in forum Wowza Streaming Server Java API
    Replies: 1
    Last Post: 09-15-2014, 07:34 AM
  3. subtitles for schedule playlist
    By sahbil in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 02-04-2014, 06:25 PM
  4. Schedule the stream
    By markmn12 in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 08-13-2013, 05:00 AM
  5. Stream Schedule Problem
    By Lethea in forum Live Streaming and Encoder Discussion
    Replies: 0
    Last Post: 09-20-2012, 04:21 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
  •