ming 3 năm trước cách đây
mục cha
commit
ed17a96a9f
1 tập tin đã thay đổi với 5 bổ sung17 xóa
  1. 5 17
      OpenshotService/openshot_video_generator.py

+ 5 - 17
OpenshotService/openshot_video_generator.py

@@ -430,8 +430,7 @@ def parse_script(file_path,gt_list):
         dic_idx = 0
         accumulated_duration = 0
         duration = dic['stop']-dic['start']
-        if duration > 5:
-            print('fuck',dic)
+
         for sub_dic in split_sentence(dic['content'],13):
             new_dic = {}
             new_dic['index'] = new_idx
@@ -674,8 +673,7 @@ def video_gen(name_hash,name,text_content, image_urls,multiLang,avatar):
     img_list = [None]*len(img_clip_list)
 
     img_file_ls = listdir(dir_photo+name_hash)
-    print(img_file_ls)
-    print(img_dict_ls)
+
     for img_idx in range(len(img_file_ls)):
         img_list[img_idx] = openshot.FFmpegReader(dir_photo+name_hash+'/'+img_file_ls[img_idx])
         img_list[img_idx].Open()
@@ -700,20 +698,10 @@ def video_gen(name_hash,name,text_content, image_urls,multiLang,avatar):
     t.Close()
     w.Close()
 
-    path = tmp_video_dir+name_hash+"script.txt"
-    f = open(path, 'r')
-    print(f.read())
-    f.close()
-    #os.remove(tmp_video_dir+name_hash+"raw.mp4")
-    #os.remove(tmp_video_dir+name_hash+"script.txt")
-    print(name+"ALL DONE : www.choozmo.com:8168/"+video_sub_folder+name_hash+"raw.mp4")
 
-    Ctr_Autosub.init()
-    Ctr_Autosub.generate_subtitles(tmp_video_dir+name_hash+".mp4",'zh',listener_progress,output=tmp_video_dir+name_hash+"script.txt",concurrency=DEFAULT_CONCURRENCY,subtitle_file_format=DEFAULT_SUBTITLE_FORMAT)
-    path = tmp_video_dir+name_hash+"script.txt"
-    f = open(path, 'r')
-    print(f.read())
-    f.close()
+    os.remove(tmp_video_dir+name_hash+"raw.mp4")
+    os.remove(tmp_video_dir+name_hash+"script.txt")
+    print(name+"ALL DONE : www.choozmo.com:8168/"+video_sub_folder+name_hash+"raw.mp4")
 
 
 def anchor_video_v2(name_hash,name,text_content, image_urls,multiLang,avatar):