A progressive MP4 file is often a good first attempt for a short clip on a website. HLS warrants its own test when viewers are accessing content under very different network conditions and when the player needs to switch between multiple quality levels. When comparing options, a simple rule helps: first keep the video content and encoding identical, and change only the delivery method.
What differs in the same test clip
For this comparison, we generated a 12-second synthetic clip using FFmpeg: 640 × 360 pixels, 25 frames per second, H.264, silent. The progressive version consists of an MP4 file with the essential metadata placed at the beginning. For the HLS version, we took the already-encoded video stream without re-encoding. This produced a playlist containing the initialization file init.mp4 and six fragmented MP4 segments, each two seconds long.
Both versions could be fully decoded locally. The printed output of the decoded video sequence, with 300 frames each, was identical. This test demonstrates how the same video stream can be packaged differently. It does not measure start time or data consumption in the browser. The HLS version had only one quality level and therefore could not switch to a lower bitrate.
FFmpeg: Settings for the HLS Muxer and fMP4
What the browser actually fetches
With progressive MP4, the player requests data from a file. If both the server and the player support byte-range requests, the network protocol can respond with status 206 to corresponding range requests. The entire file does not need to be downloaded before playback begins. In HLS, a playlist references media segments, while in fragmented MP4, the initialization segment is referenced. Switching during playback is only possible when multiple appropriate quality levels are available and a compatible player is used.
RFC 9110 on HTTP Scope Requests
RFC 8216 on HLS Playlists, Segments, and Variants
Choose the right format for your website
- Test both versions using the same clip on the actual target platform. Ensure the device, network profile, autoplay setting, and cache state are comparable.
- Miss the time from start click until the first visible image appears. Then jump to the same position further back and observe when the image restarts and which requests are triggered.
- If changing connections trigger HLS, additionally test multiple quality levels and throttle the network during playback. Check whether the player switches between quality levels and if the clip can be played continuously.
Based on the specific video. For a short product video, an MP4 file is easier to publish. For a longer lesson with viewers using different mobile networks, test results across multiple quality levels are more informative than file size alone.