Update src/streamlit_app.py
Browse files- src/streamlit_app.py +7 -1
src/streamlit_app.py
CHANGED
@@ -39,7 +39,9 @@ def download_video(url, output_dir="/app/tmp"):
|
|
39 |
ydl.download([url])
|
40 |
return os.path.join(output_dir, "video.mp4")
|
41 |
|
42 |
-
def extract_audio(input_path,
|
|
|
|
|
43 |
(
|
44 |
ffmpeg
|
45 |
.input(input_path)
|
@@ -100,10 +102,14 @@ if st.button("Analyze"):
|
|
100 |
else:
|
101 |
with st.spinner("Downloading video..."):
|
102 |
video_path = download_video(video_url)
|
|
|
|
|
103 |
# pass
|
104 |
|
105 |
with st.spinner("Extracting audio..."):
|
106 |
audio_path = extract_audio(video_path)
|
|
|
|
|
107 |
# pass
|
108 |
|
109 |
with st.spinner("Transcribing with Whisper..."):
|
|
|
39 |
ydl.download([url])
|
40 |
return os.path.join(output_dir, "video.mp4")
|
41 |
|
42 |
+
def extract_audio(input_path, output_dir="/app/tmp"):
|
43 |
+
os.makedirs(output_dir, exist_ok=True)
|
44 |
+
output_path = os.path.join(output_dir, "audio.mp3")
|
45 |
(
|
46 |
ffmpeg
|
47 |
.input(input_path)
|
|
|
102 |
else:
|
103 |
with st.spinner("Downloading video..."):
|
104 |
video_path = download_video(video_url)
|
105 |
+
st.write("Video saved at:", video_path)
|
106 |
+
st.write("Exists:", os.path.exists(video_path))
|
107 |
# pass
|
108 |
|
109 |
with st.spinner("Extracting audio..."):
|
110 |
audio_path = extract_audio(video_path)
|
111 |
+
st.write("Audio saved at:", audio_path)
|
112 |
+
st.write("Exists:", os.path.exists(audio_path))
|
113 |
# pass
|
114 |
|
115 |
with st.spinner("Transcribing with Whisper..."):
|