Is there any advantage of using HLS (HTTP Live Streaming) over HTML5 <video>
for sharing large video files? I am using ffmpeg
to create chunks and the associated m3u8
manifest file manually on my server for sharing large video files, and use libraries like hls.js
for integrating it in my website. Previously I share the video file directly using <video>
tag (eg: <video src="/path/to/some_video.mp4">
I know HTML5 video uses HTTP Progressive Download, and the webserver would use moov
atom in the video file to serve small progressive chunks. On the other hand, in the case of HLS, I manually create the chunks on the server side so that my browser can request them directly through the m3u8 manifest file. I believe the HTML5 video causes the webserver to spend extra CPU cycles chunking the video using the moov
atom on the fly, whereas in the HLS case, it doesn't spend any cycles for chunking and can serve the pre-chunked file on HTTP GET. So I think HLS may reduce CPU workload on the server side when serving video files since the pieces are pre-chunked.
I am not sure if that's true, and I'd like to get some insights into this: using HTML5 video vs HLS for serving video files.