Is anyone else finding st.video NOT WORKING for their own mp4 video files, but IS WORKING for youtube urls.
I have tried my best to figure this one out, but hitting a wall now after lots of tries.
I’m using code just as in the API (below), and made sure my test video sample is H.264 encoded, and is routed to the folder where the file is, so I think I’ve avoided all simple mistakes. Interestingly, the Streamlit API webpage video is no longer showing the lovely starry night sky video it did a few months back (both on my laptop and my phone) which has prompted me to think it could be Streamlit rather than me?!
Thanks for clarifying @ajhayes83, I didn’t realize that a video can both be mp4 (which is a container) AND H.264. I’ll consider how the docs could be changed. edit: on careful reading, I see that the docs are correct in that they mention the encoding not being mp4v, not that a video can’t both be mp4 and h.264. Will be more careful in future responses…
However, this is working for me on Ubuntu 18.04 and Chrome:
import streamlit as st
with open("/home/rzwitch/Downloads/TextInMotion-VideoSample-576p.mp4", 'rb') as v:
st.video(v)
Hi, thanks.
I switched from Safari v13.1 to Firefox browser 78.0.1 and it works on Firefox! So its a browser problem! Nothing to do with Streamlit. I might need to add a ‘troubleshooting’ sidebar radiobutton to the Streamlit App I’m working on to alert users that Safari browser may struggle with video…I’ll have a think.
I don’t know if you think it could be worth adding a note to your Streamlit API at the st.video docstring about this (Safari) browser problem to avoid others falling into same trap as me..
Thanks for your patience.
Alastair