Ver Fonte

spliter fix

ming há 3 anos atrás
pai
commit
b6f5d911e1
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      OpenshotService/openshot_video_generator.py

+ 2 - 2
OpenshotService/openshot_video_generator.py

@@ -269,7 +269,7 @@ def parse_script(file_path,gt_list):
                 if t != (times-1):
                     time_ratio[t] = 1 * dic['duration']/times
                 else:
-                    time_ratio[t] = left_words/13 * dic['duration'] / times
+                    time_ratio[t] = 1 * dic['duration'] / times
             for t in range(times):
                 if True:
                 #if time_ratio[t]>0.22:#about less than 3 words
@@ -281,7 +281,7 @@ def parse_script(file_path,gt_list):
                         start_plus += time_ratio[t2]
                     new_dic['start'] =  dic['start'] + start_plus
                     new_dic['stop'] = new_dic['start']+time_ratio[t]
-                    new_dic['duration'] = time_ratio[t]
+                    new_dic['duration'] = time_ratio[t]-0.1
                     splitted_dict.append(new_dic)
                     new_idx+=1
                 #else: