Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -114,14 +114,14 @@ with gr.Blocks() as blocks_app:
|
|
114 |
def transcribe_and_add_subtitles(video_file):
|
115 |
transcription = transcribe(video_file, "tiny")
|
116 |
srt_path = text_to_srt(transcription)
|
117 |
-
output_video_path = add_subtitle_to_video(video_file
|
118 |
return output_video_path, srt_path
|
119 |
|
120 |
def translate_subtitles_and_add_to_video(video_file, source_language_code, target_language_code):
|
121 |
transcription = transcribe(video_file, "tiny")
|
122 |
srt_path = text_to_srt(transcription)
|
123 |
translated_srt_path = translate_srt(srt_path, source_language_code, target_language_code)
|
124 |
-
output_video_path = add_subtitle_to_video(video_file
|
125 |
return output_video_path, translated_srt_path
|
126 |
|
127 |
transcribe_button.click(transcribe_and_add_subtitles, inputs=video_file, outputs=[output_video, output_srt])
|
|
|
114 |
def transcribe_and_add_subtitles(video_file):
|
115 |
transcription = transcribe(video_file, "tiny")
|
116 |
srt_path = text_to_srt(transcription)
|
117 |
+
output_video_path = add_subtitle_to_video(video_file, srt_path, subtitle_language="eng", soft_subtitle=False)
|
118 |
return output_video_path, srt_path
|
119 |
|
120 |
def translate_subtitles_and_add_to_video(video_file, source_language_code, target_language_code):
|
121 |
transcription = transcribe(video_file, "tiny")
|
122 |
srt_path = text_to_srt(transcription)
|
123 |
translated_srt_path = translate_srt(srt_path, source_language_code, target_language_code)
|
124 |
+
output_video_path = add_subtitle_to_video(video_file, translated_srt_path, target_language_code, soft_subtitle=False)
|
125 |
return output_video_path, translated_srt_path
|
126 |
|
127 |
transcribe_button.click(transcribe_and_add_subtitles, inputs=video_file, outputs=[output_video, output_srt])
|