Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,13 +39,19 @@ def download_video(url):
|
|
| 39 |
print(f"Downloaded successfully")
|
| 40 |
return "video.mp4"
|
| 41 |
|
| 42 |
-
def main(url, clip_type):
|
| 43 |
|
|
|
|
| 44 |
video = download_video(url)
|
|
|
|
| 45 |
mp3_file, duration = extract_audio(video)
|
|
|
|
| 46 |
srt_list = transcribe(mp3_file)
|
|
|
|
| 47 |
subtitle_file = translate(srt_list)
|
|
|
|
| 48 |
output_video_file = video_edit(subtitle_file, video, input_audio= "audio.mp3")
|
|
|
|
| 49 |
os.remove(subtitle_file)
|
| 50 |
return output_video_file
|
| 51 |
|
|
|
|
| 39 |
print(f"Downloaded successfully")
|
| 40 |
return "video.mp4"
|
| 41 |
|
| 42 |
+
def main(url, clip_type, progress=gr.Progress()):
|
| 43 |
|
| 44 |
+
progress(0, desc="Starting")
|
| 45 |
video = download_video(url)
|
| 46 |
+
progress(5, desc="downloaded")
|
| 47 |
mp3_file, duration = extract_audio(video)
|
| 48 |
+
progress(10, desc="extract audio")
|
| 49 |
srt_list = transcribe(mp3_file)
|
| 50 |
+
progress(35, desc="transcribe")
|
| 51 |
subtitle_file = translate(srt_list)
|
| 52 |
+
progress(55, desc="translate")
|
| 53 |
output_video_file = video_edit(subtitle_file, video, input_audio= "audio.mp3")
|
| 54 |
+
progress(100, desc="finish")
|
| 55 |
os.remove(subtitle_file)
|
| 56 |
return output_video_file
|
| 57 |
|