html5 video safari 在播放前下载完整 [英] html5 video safari downloads full before playing

查看:28
本文介绍了html5 video safari 在播放前下载完整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道为什么我的 mp4 html5 视频不是流式传输"而是等到它完全下载后才开始在 safari 中播放.

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

www.pija.se

我尝试过 QTIndexSwapper,但它说索引在正确的位置.

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

感谢任何帮助.

推荐答案

看起来 MOOV 原子不在文件的开头.我使用 ffmpeg 重新定位(没有其他编码),然后进行二进制比较(使用 HexFiend)和快速测试似乎表明 Safari 可以更快地播放视频

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 我发现 ffmpeg 是一个很好的解决方案,尤其是对于背景视频,你会想要 调整参数 以针对您的用例进行优化

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

这篇关于html5 video safari 在播放前下载完整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆