Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,13 +29,12 @@ def translate(input_video):
|
|
29 |
result = model.transcribe(audio_file,**translate_options)
|
30 |
|
31 |
output_dir = ''
|
32 |
-
|
33 |
-
|
34 |
-
with open(os.path.join(output_dir, audio_path + ".vtt"), "w") as vtt:
|
35 |
write_vtt(result["segments"], file=vtt)
|
36 |
|
37 |
-
subtitle
|
38 |
-
output_video =
|
39 |
|
40 |
os.system(f"ffmpeg -i {input_video} -vf subtitles={subtitle} {output_video}")
|
41 |
|
|
|
29 |
result = model.transcribe(audio_file,**translate_options)
|
30 |
|
31 |
output_dir = ''
|
32 |
+
|
33 |
+
with open(os.path.join(output_dir, 'audio' + ".vtt"), "w") as vtt:
|
|
|
34 |
write_vtt(result["segments"], file=vtt)
|
35 |
|
36 |
+
subtitle = "subtitles.vtt"
|
37 |
+
output_video = "subtitled.mp4"
|
38 |
|
39 |
os.system(f"ffmpeg -i {input_video} -vf subtitles={subtitle} {output_video}")
|
40 |
|