St.video() doesn't show opencv-generated mp4

Hello there,

I am currently trying to show a video which is generated by openCV’s VideoWriter and codec mp4v.
The video is indeed there and playable locally, but st.video() won’t show it.

I tried with st.video() argument being either:

  • Local path to video
  • IOBytes format
  • np.array

None of this was successful, do you have any idea why ?

Thanks a lot,

Virgile

My bad, I just got it.

OpenCV’s mp4v codec is just not supported by HTML5 Video Player at the moment, one just need to use another encoding option (most likely x264 for mp4 videos).

1 Like

Hey @virgile_b, welcome to the Streamlit forum! Glad you got it figured out :slight_smile:

1 Like

There is a problem that my local video can display but without voice,and the voice icon is gray that cant be clicked,thank you for the problem