Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -566,13 +566,14 @@ if __name__ == "__main__":
|
|
| 566 |
st.write("Video Input Options")
|
| 567 |
# video_file = st.file_uploader("Upload a MP4 video file", type=[
|
| 568 |
# "mp4"], disabled=st.session_state.is_processing, on_change=set_processing, args=(True,))
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
| 574 |
-
|
| 575 |
-
|
|
|
|
| 576 |
# st.write("OR")
|
| 577 |
video_url = st.text_input(
|
| 578 |
"Enter the URL of a MP4 video (Youtube or other)",
|
|
|
|
| 566 |
st.write("Video Input Options")
|
| 567 |
# video_file = st.file_uploader("Upload a MP4 video file", type=[
|
| 568 |
# "mp4"], disabled=st.session_state.is_processing, on_change=set_processing, args=(True,))
|
| 569 |
+
video_file = None
|
| 570 |
+
if video_file is not None:
|
| 571 |
+
# Write uploaded file to a stable location
|
| 572 |
+
save_path = os.path.join("/tmp", video_file.name)
|
| 573 |
+
with open(save_path, "wb") as f:
|
| 574 |
+
f.write(video_file.read())
|
| 575 |
+
st.video(save_path) # Use the saved file path, not internal Streamlit ID
|
| 576 |
+
st.success(f"Saved and loaded video from: {save_path}")
|
| 577 |
# st.write("OR")
|
| 578 |
video_url = st.text_input(
|
| 579 |
"Enter the URL of a MP4 video (Youtube or other)",
|