I see what you mean now! Thank you, the screenshot was really helpful.
Hmmmmm⌠this might be a a codec issue with Safari and QuickTime in particular? Chrome and Firefox on my Mac do not have this issue (I believe they use their own video renderers?). I bet it affects iPhone too, but I donât have one to test with right this momentâŚ
It might have to do the particular way Mux is re-encoding the file? Let me speak to their support team on this and get back to you as soon as I can!
Iâm not a codec expert, but at first glance, it looks like the Mux version is missing a keyframe at 0.00 seconds that the original has:
Original:
> ffprobe -loglevel error -select_streams v:0 -show_entries packet=pts_time,flags -of csv=print_section=0 original.mp4 | awk -F',' '/K/ {print $1}'
0.000000
3.003000
6.006000
9.009000
12.012000
Mux version:
ffprobe -loglevel error -select_streams v:0 -show_entries packet=pts_time,flags -of csv=print_section=0 high.mp4 | awk -F',' '/K/ {print $1}'
0.085000
4.989900
9.994900
As a workaround, if you add a start time to the URL, it seems to skip the initial fractions of a second and go straight to the first keyframe: https://stream.mux.com/6V48g3boltSf5uQRB8HnelvtPglzZzYu/high.mp4#t=0.085 (does that make a difference for you at all? It seems to work on my computer)
Iâll report this to Mux and see what they say. Thank you for the report! Iâll write back as soon as I can.
Separate from the frames issue though, can I recommend (IMHO only) that you see if thereâs any tweaking you might be able to do the <VideoPlayer/>
component, perhaps by adding preload='auto'
to its props to see if that helps at all?
If you just use the raw high.mp4 as your video source, youâre forcing all your visitors to download the full-res video just for an animated hero background, and as much of it as they can, even if they scroll right past it right after a second.
If the preload doesnât work, you MIGHT be able to use the .m3u8 as the source, but itâs not clear to me whether (as of 2024) that works correctly in modern browsers: streaming - Playing m3u8 Files with HTML Video Tag - Stack Overflow
Otherwise, Mux has a lightweight polyfill: Mux-flavored HTML video tag | Mux
Or Video.js might be quicker to load? https://videojs.com/
If any of those solutions are acceptably fast for you, they should be much better than serving the MP4 directly.