html5 video safari downloads full before playing

前端 未结 1 1461
春和景丽
春和景丽 2020-12-06 15:55

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

相关标签:
1条回答
  • 2020-12-06 16:16

    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

    0 讨论(0)
提交回复
热议问题