1010
1111st .set_page_config (page_title = "VideoLingo" , page_icon = "docs/logo.svg" )
1212
13+ SUB_VIDEO = "output/output_sub.mp4"
14+ DUB_VIDEO = "output/output_dub.mp4"
15+
1316def text_processing_section ():
1417 st .header ("翻译和生成字幕" )
1518 with st .container (border = True ):
@@ -25,16 +28,16 @@ def text_processing_section():
2528 6. 将字幕合并到视频中
2629 """ , unsafe_allow_html = True )
2730
28- if not os .path .exists ("output/output_video_with_subs.mp4" ):
31+ if not os .path .exists (SUB_VIDEO ):
2932 if st .button ("开始处理字幕" , key = "text_processing_button" ):
3033 process_text ()
3134 st .rerun ()
3235 else :
3336 if load_key ("resolution" ) != "0x0" :
34- st .video ("output/output_video_with_subs.mp4" )
37+ st .video (SUB_VIDEO )
3538 download_subtitle_zip_button (text = "下载所有字幕" )
3639
37- if st .button ("归档到'history '" , key = "cleanup_in_text_processing" ):
40+ if st .button ("归档到'历史记录 '" , key = "cleanup_in_text_processing" ):
3841 cleanup ()
3942 st .rerun ()
4043 return True
@@ -60,24 +63,25 @@ def process_text():
6063 st .balloons ()
6164
6265def audio_processing_section ():
63- st .header ("配音(测试版) " )
66+ st .header ("配音" )
6467 with st .container (border = True ):
6568 st .markdown ("""
6669 <p style='font-size: 20px;'>
6770 此阶段包含以下步骤:
6871 <p style='font-size: 20px;'>
69- 1. 生成音频任务<br>
70- 2. 生成音频<br>
71- 3. 将音频合并到视频中
72+ 1. 生成音频任务和分段<br>
73+ 2. 提取参考音频<br>
74+ 3. 生成和合并音频文件<br>
75+ 4. 将最终音频合并到视频中
7276 """ , unsafe_allow_html = True )
73- if not os .path .exists ("output/output_video_with_audio.mp4" ):
77+ if not os .path .exists (DUB_VIDEO ):
7478 if st .button ("开始处理音频" , key = "audio_processing_button" ):
7579 process_audio ()
7680 st .rerun ()
7781 else :
7882 st .success ("音频处理完成!你可以在 `output` 文件夹中查看音频文件。" )
7983 if load_key ("resolution" ) != "0x0" :
80- st .video ("output/output_video_with_audio.mp4" )
84+ st .video (DUB_VIDEO )
8185 if st .button ("删除配音文件" , key = "delete_dubbing_files" ):
8286 delete_dubbing_files ()
8387 st .rerun ()
@@ -88,12 +92,15 @@ def audio_processing_section():
8892def process_audio ():
8993 with st .spinner ("生成音频任务中" ):
9094 step8_1_gen_audio_task .gen_audio_task_main ()
95+ step8_2_gen_dub_chunks .gen_dub_chunks ()
9196 with st .spinner ("提取参考音频中" ):
9297 step9_extract_refer_audio .extract_refer_audio_main ()
93- with st .spinner ("生成音频中" ):
94- step10_gen_audio .process_sovits_tasks ()
95- with st .spinner ("将音频合并到视频中" ):
96- step11_merge_audio_to_vid .merge_main ()
98+ with st .spinner ("生成所有音频中" ):
99+ step10_gen_audio .gen_audio ()
100+ with st .spinner ("合并完整音频中" ):
101+ step11_merge_full_audio .merge_full_audio ()
102+ with st .spinner ("将配音合并到视频中" ):
103+ step12_merge_dub_to_vid .merge_video_audio ()
97104
98105 st .success ("音频处理完成!🎇" )
99106 st .balloons ()
0 commit comments