html5 video safari downloads full before playing

半城伤御伤魂 提交于 2019-12-29 07:19:14

问题


Im wondering why my mp4 html5 video is not "streaming" and instead waits till it is fully downloaded before it starts playing in safari.

www.pija.se

I have tried QTIndexSwapper but it says the index is in the right position.

Any help appreciated.


回答1:


looks like the MOOV atom isn't at the beginning of the file. I used ffmpeg to just relocate that (no other encoding) and then a binary compare (using HexFiend) and a quick test seemed to show that Safari was playing the video sooner

./ffmpeg -i top.mp4 -codec copy -movflags faststart top-fs.mp4

(caveat being that even though I cleared browser cache I didn't do things like bounce my test server or time things too accurately)

FWIW I find ffmpeg to be a good solution, and especially for background video you'll want to play around with parameters to optimize for your use-case



来源:https://stackoverflow.com/questions/28503324/html5-video-safari-downloads-full-before-playing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!