Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def add_subtitle_to_video(input_video, subtitle_file, subtitle_language, soft_su
|
|
34 |
|
35 |
def video_demo(video, subtitle, subtitle_type, subtitle_language):
|
36 |
if subtitle is not None:
|
37 |
-
soft_subtitle =
|
38 |
processed_video_path = add_subtitle_to_video(video, subtitle, subtitle_language, soft_subtitle)
|
39 |
return processed_video_path
|
40 |
else:
|
@@ -42,11 +42,12 @@ def video_demo(video, subtitle, subtitle_type, subtitle_language):
|
|
42 |
|
43 |
demo = gr.Interface(
|
44 |
fn=video_demo,
|
|
|
|
|
45 |
inputs=[
|
46 |
gr.Video(label="Video", interactive=True),
|
47 |
gr.File(label="Subtitle", file_types=[".srt", ".vtt"]),
|
48 |
-
gr.
|
49 |
-
gr.Textbox(label="Subtitle Language (ISO 639-1 code, e.g., 'en' for English)"),
|
50 |
],
|
51 |
outputs=gr.Video(label="Processed Video"),
|
52 |
)
|
|
|
34 |
|
35 |
def video_demo(video, subtitle, subtitle_type, subtitle_language):
|
36 |
if subtitle is not None:
|
37 |
+
soft_subtitle = "Hard"
|
38 |
processed_video_path = add_subtitle_to_video(video, subtitle, subtitle_language, soft_subtitle)
|
39 |
return processed_video_path
|
40 |
else:
|
|
|
42 |
|
43 |
demo = gr.Interface(
|
44 |
fn=video_demo,
|
45 |
+
gr.Markdown("# Text to SRT Converter"),
|
46 |
+
gr.Markdown("### ⚠️ For information, the process can be really long.")
|
47 |
inputs=[
|
48 |
gr.Video(label="Video", interactive=True),
|
49 |
gr.File(label="Subtitle", file_types=[".srt", ".vtt"]),
|
50 |
+
gr.Textbox(label="Subtitle Language (ISO 639-1 code, 'en' for English)"),
|
|
|
51 |
],
|
52 |
outputs=gr.Video(label="Processed Video"),
|
53 |
)
|