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
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.