Spaces:
Runtime error
Runtime error
Commit
·
46226f2
1
Parent(s):
3273372
order change again
Browse files
app.py
CHANGED
@@ -39,7 +39,7 @@ with gr.Blocks() as demo:
|
|
39 |
output_file.render()
|
40 |
output_file.change(prepare_video_subtitle, inputs=[
|
41 |
input_video, start_time, end_time], outputs=output_video)
|
42 |
-
|
43 |
adjust_speaker, adjust_audio, prev_button, next_button, adjust_button])
|
44 |
|
45 |
with gr.Column():
|
|
|
39 |
output_file.render()
|
40 |
output_file.change(prepare_video_subtitle, inputs=[
|
41 |
input_video, start_time, end_time], outputs=output_video)
|
42 |
+
output_file.change(prepare_output, inputs=input_video, outputs=[
|
43 |
adjust_speaker, adjust_audio, prev_button, next_button, adjust_button])
|
44 |
|
45 |
with gr.Column():
|
set_up.py
CHANGED
@@ -10,6 +10,15 @@ import utils
|
|
10 |
|
11 |
|
12 |
def prepare_video_subtitle(input_file, start_time, end_time, progress=gr.Progress()):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
# Add subtitle to video
|
14 |
progress(0.8, desc=ui_lang["progress_add_subtitle"])
|
15 |
add_subtitle_to_video(input_file, base_subtitle_file,
|
|
|
10 |
|
11 |
|
12 |
def prepare_video_subtitle(input_file, start_time, end_time, progress=gr.Progress()):
|
13 |
+
if input_file is None or not os.path.exists(input_file):
|
14 |
+
gr.Warning(ui_lang["input_video_warning"])
|
15 |
+
return [None, None, [None, None]]
|
16 |
+
if validate_time_format(start_time) is False:
|
17 |
+
gr.Warning(ui_lang["start_time_warning"])
|
18 |
+
return [None, None, [None, None]]
|
19 |
+
if validate_time_format(end_time) is False:
|
20 |
+
gr.Warning(ui_lang["end_time_warning"])
|
21 |
+
return [None, None, [None, None]]
|
22 |
# Add subtitle to video
|
23 |
progress(0.8, desc=ui_lang["progress_add_subtitle"])
|
24 |
add_subtitle_to_video(input_file, base_subtitle_file,
|