Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -81,15 +81,15 @@ def add_subtitle_to_video(input_video, subtitle_file, subtitle_language, soft_su
|
|
81 |
ffmpeg.run(stream, overwrite_output=True)
|
82 |
return output_video
|
83 |
|
84 |
-
st.title("Video
|
85 |
|
86 |
-
uploaded_file = st.file_uploader("Upload Video", type=["mp4", "avi", "mov"])
|
87 |
-
action = st.radio("Select Action", ["Transcribe and Add Subtitles", "Transcribe, Translate and Add Subtitles"])
|
88 |
-
source_language = st.selectbox("Source Language", options=language_options, index=language_options.index('en'))
|
89 |
-
target_language = st.selectbox("Target Language", options=language_options, index=language_options.index('fr'))
|
90 |
-
model_size = st.selectbox("Model Size", options=model_size_options)
|
91 |
|
92 |
-
if st.button("Process Video"):
|
93 |
if uploaded_file is not None:
|
94 |
with st.spinner('Processing...'):
|
95 |
audio_file_path = f"/tmp/{uploaded_file.name}"
|
@@ -103,4 +103,4 @@ if st.button("Process Video"):
|
|
103 |
translated_srt_path = translate_text(srt_path, source_language, target_language)
|
104 |
output_video_path = add_subtitle_to_video(audio_file_path, translated_srt_path, target_language, soft_subtitle=False)
|
105 |
st.video(output_video_path)
|
106 |
-
st.success("Processing Completed")
|
|
|
81 |
ffmpeg.run(stream, overwrite_output=True)
|
82 |
return output_video
|
83 |
|
84 |
+
st.title("Video Subtitle Creation")
|
85 |
|
86 |
+
uploaded_file = st.file_uploader("πΉ Upload Video", type=["mp4", "avi", "mov"])
|
87 |
+
action = st.radio("π§· Select Action", ["Transcribe and Add Subtitles", "Transcribe, Translate and Add Subtitles"])
|
88 |
+
source_language = st.selectbox("1οΈβ£ Source Language", options=language_options, index=language_options.index('en'))
|
89 |
+
target_language = st.selectbox("2οΈβ£ Target Language", options=language_options, index=language_options.index('fr'))
|
90 |
+
model_size = st.selectbox("π Model Size", options=model_size_options)
|
91 |
|
92 |
+
if st.button("π Process Video"):
|
93 |
if uploaded_file is not None:
|
94 |
with st.spinner('Processing...'):
|
95 |
audio_file_path = f"/tmp/{uploaded_file.name}"
|
|
|
103 |
translated_srt_path = translate_text(srt_path, source_language, target_language)
|
104 |
output_video_path = add_subtitle_to_video(audio_file_path, translated_srt_path, target_language, soft_subtitle=False)
|
105 |
st.video(output_video_path)
|
106 |
+
st.success("π’ Processing Completed")
|