Insert a yolov5 saved video

I have a saved video that has detected object using yolov5. The video is 2mb and mp4

video_file = open(r"C:\Users\Bob\Video-Analytics-Dashboard\runs\detect\exp\fire_cut2.mp4", 'rb')
    video_bytes = video_file.read()
    st.video(video_bytes)

Expected behavior:

I expect the code to run the video. However, it does not shows.

1 Like

Hi @Aynera_Kj_B,

Thanks for posting and welcome to the forum! I am assuming you’re running the app locally at the moment.

It is possible that the video file path is not correct. Make sure that the path to the video file is correct and accessible.

It is also possible that the video format has some issues, although Streamlit does support .mp4. You can try adding the video to the same directory as your code and try using the relative path from there to make sure it plays. That will rule out the video format issue.

Let me know if this helps.

Hello @tonykip

The file path is correct and the video still not showing up. However i found a way to resolve this by uploading the video, and download it then insert the downloaded video. I think there’s a problem when trying to insert a video that have executed by yolov5 model. Moreover, thanks for response.

1 Like

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