Esempio n. 1
0
 def write_config(self, config_file):
     """Write a config file for the analyzed content, that can then be used to serve it efficiently."""
     cfg_data = {'version' : '1.1', 'first_segment_in_loop' : self.firstSegmentInLoop,
                 'nr_segments_in_loop' : self.nrSegmentsInLoop, 'segment_duration_s' : self.segDuration}
     media_data = {}
     for content_type in ('video', 'audio'):
         if content_type in self.as_data:
             mdata = self.as_data[content_type]
             media_data[content_type] = {'representations' : [rep['id'] for rep in mdata['reps']],
                                         'timescale' : mdata['track_timescale'],
                                         'totalDuration' : mdata['totalTicks'],
                                         'datFile' : mdata['datFile']}
     cfg_data['media_data'] = media_data
     vod_cfg = configprocessor.VodConfig()
     vod_cfg.write_config(config_file, cfg_data)
Esempio n. 2
0
 def testReadVodConfigFile(self):
     cfg_file = os.path.join(VOD_CONFIG_DIR, 'testpic.cfg')
     ifh = open(cfg_file, "rb")
     vod_cfg = configprocessor.VodConfig()
     vod_cfg.read_config(cfg_file)