Ver código fonte

shorten sub duration

ming 3 anos atrás
pai
commit
d7849f7912
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      OpenshotService/openshot_video_generator.py

+ 3 - 3
OpenshotService/openshot_video_generator.py

@@ -340,8 +340,8 @@ def parse_script(file_path,gt_list):
         time_raw = raw_lines[idx * 4 +1 ].split(' --> ')
         start = time_raw[0].split(':')
         stop = time_raw[1].split(':')
-        script['start'] = float(start[0])*3600 + float(start[1])*60 + float(start[2].replace(',','.'))+0.3
-        script['stop'] = float(stop[0])*3600 + float(stop[1])*60 + float(stop[2].replace(',','.'))-0.3
+        script['start'] = float(start[0])*3600 + float(start[1])*60 + float(start[2].replace(',','.'))
+        script['stop'] = float(stop[0])*3600 + float(stop[1])*60 + float(stop[2].replace(',','.'))
         dict_list.append(script)
     #merge duplicated sentences
     script_not_dup_list = []
@@ -374,7 +374,7 @@ def parse_script(file_path,gt_list):
             new_dic = {}
             new_dic['index'] = new_idx
             new_idx+=1
-            ind_duration = duration * sub_dic['time_ratio']*0.8
+            ind_duration = duration * sub_dic['time_ratio']*0.6
             new_dic['start'] = dic['start'] + accumulated_duration
             accumulated_duration += ind_duration