Lenylvt commited on
Commit
5a38be6
β€’
1 Parent(s): 24cf2ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
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 Subtitling and Translation")
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")