Path to file

Hello. I use st.file_uploader( for upload video-file. I get video - st.file_uploader(label, type=โ€˜mp4โ€™ ). Then i can to play video. But i use the function , it need path to video-file. I can use path only from github. But users cant to upload file to github. Do you know how to get some path to file?

Which function? doesnโ€™t need a path.

data = st.file_uploader(label="Upload file", type="mp4"), format="video/mp4")

It YoloTracking. Neural network. It need a path to video. I can`t to change it.

Store the data in a temporary file and pass the file name to your video function. I donโ€™t know if flushing is necessary but better safe than sorry.

import tempfile
import streamlit as st

def video_function(path):, format="video/mp4")

data = st.file_uploader(label="Upload file", type="mp4")

with tempfile.NamedTemporaryFile() as f:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.