HTML5 video not streaming and taking 90 seconds to load

Because you’re having to move the file over the public internet, rather than local network you’ll want to use something like ffmpeg to move the meta data (MOOV atom) to the front of the video file so it can start streaming faster

./ffmpeg -y -i SourceFile.mp4 -s 1280x720 -c:v libx264 -b 3M -strict -2 -movflags faststart DestFile.mp4

The above will give you a 1280×720 output, at 3Mbps using h264 in an mp4 container, and will then do a second pass to move the moov element to the front of the file enabling it to start streaming faster (see this answer for some more detail).

You should also check that your Production server configuration matches your dev server, specifically the ability to support byte-range requests that allow more optimal streaming of content

Leave a Comment