Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def download_video(url):
|
|
40 |
print(f"Downloaded successfully")
|
41 |
return "video.mp4"
|
42 |
|
43 |
-
def main(url, clip_type, progress=gr.Progress()):
|
44 |
|
45 |
if clip_type == "dub":
|
46 |
progress(0, desc="Starting")
|
@@ -65,7 +65,8 @@ def main(url, clip_type, progress=gr.Progress()):
|
|
65 |
progress(35, desc="transcribe")
|
66 |
subtitle_file = translate(srt_list)
|
67 |
progress(55, desc="translate")
|
68 |
-
|
|
|
69 |
progress(100, desc="finish")
|
70 |
os.remove(subtitle_file)
|
71 |
return output_video_file
|
@@ -75,9 +76,10 @@ with gr.Blocks() as demo:
|
|
75 |
with gr.Column():
|
76 |
video_file_input = gr.Text(label="Upload Video url")
|
77 |
clip_type = gr.Dropdown(["dub", "sub"], label="Clip Type")
|
|
|
78 |
btn = gr.Button("create")
|
79 |
video_file_output = gr.Video(label="result: ")
|
80 |
-
btn.click(fn=main, inputs=[video_file_input, clip_type], outputs=video_file_output)
|
81 |
""" with gr.Row():
|
82 |
vid_out = gr.Video()
|
83 |
srt_file = gr.File()
|
|
|
40 |
print(f"Downloaded successfully")
|
41 |
return "video.mp4"
|
42 |
|
43 |
+
def main(url, clip_type, parameters, progress=gr.Progress()):
|
44 |
|
45 |
if clip_type == "dub":
|
46 |
progress(0, desc="Starting")
|
|
|
65 |
progress(35, desc="transcribe")
|
66 |
subtitle_file = translate(srt_list)
|
67 |
progress(55, desc="translate")
|
68 |
+
print(parameters)
|
69 |
+
output_video_file = video_edit(subtitle_file, video, parameters, input_audio= "audio.mp3")
|
70 |
progress(100, desc="finish")
|
71 |
os.remove(subtitle_file)
|
72 |
return output_video_file
|
|
|
76 |
with gr.Column():
|
77 |
video_file_input = gr.Text(label="Upload Video url")
|
78 |
clip_type = gr.Dropdown(["dub", "sub"], label="Clip Type")
|
79 |
+
parameters = gr.List()
|
80 |
btn = gr.Button("create")
|
81 |
video_file_output = gr.Video(label="result: ")
|
82 |
+
btn.click(fn=main, inputs=[video_file_input, clip_type, parameters], outputs=video_file_output)
|
83 |
""" with gr.Row():
|
84 |
vid_out = gr.Video()
|
85 |
srt_file = gr.File()
|