Video file upload

How can I read an uploaded video using OpenCV?
The file format is io Bytes, and I can’t get a way for even store it and then load it for frame processing.
Any suggestions?

Hi @MarioNavarrete welcome to the forum !

I think I recently saw a solution writing the io.Bytes into a temporary file before reading it with the library you like, check this answer. But I’m not sure it solves your problem when you say you can’t store anything on disk ?

Let us know how this goes,

Thanks for the reply!
Yes, after I posted my question, I found the same thread and I was able to save on disk the!

1 Like

Hi @MarioNavarrete, I am running into the same problem as you, but I am not able to figure out how to write the io.Bytes into a temporary file for a video. Could give an example of how to do it? Thanks in advance!

Hi @raychen930, welcome to the Streamlit community!

Does this solve the issue you are running into?

Hi Randy, thanks for the quick reply. My problem is slightly different in that I am trying to use the imagio’s get_reader function on an uploaded Streamlit video file, but I am getting a “‘Could not find a format to read the specified file in %s mode’ % modename” error. I tried the solution from the other question but I still am unable to format the file properly for the imageio funciton.

If your problem isn’t the same as this one, then it’s better to create a new topic. Post your code, along with the error message and someone will be able to help you figure it out :slight_smile:

Ok, thanks!