Since uploaded files are stored in RAM, it is not accessible to get the absolute paths.
Moviepy also supports reading a video file with the NumPy array, but I have no idea how to get the duration of the video. The duration should be specified with the NumPy array.
My code is below.
import streamlit as st from moviepy.editor import VideoFileClip files = st.sidebar.file_uploader('File uploader', accept_multiple_files=True, type=['mp4']) for f in files: video = VideoFileClip(f) # This gives an error!!!