Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can use ffmpeg to convert your video to HLS/Dash format and host it behind your run-of-the-mill nginx webserver as static contents. Then on your webpages, just use hls.js [0] to embed those uploaded videos in a webpages. hls.js will handle adaptive bitrate automatically, so the videos should load pretty fast for your visitor, though probably not as fast as youtube since they have edge servers everywhere, but still a lot faster than just hosting an .mp4 file and load it via <video> tag.

You don't need fancy plugins or webservers just to serve adaptive bitrate anymore these days as HLS/Dash provides many benefits of RTMP without the complexity cost. You only need to worry about bandwidth / cdn cost, and the cheapest bandwidth can be bought via hosting providers like hetzner and ovh.

[0] https://github.com/video-dev/hls.js/



Thanks, I think I'll do a combination of this with a fallback to downloadable MP4 and inline video tags for clients without Javascript.

You say to convert to HLS/Dash, does hls.js support both? Pros cons of one other the other? Make sense to do both?


HLS seem to be the more popular format these days and browsers seem to start supporting it natively. I said hls/dash because both formats offers mostly the same benefit compared to just simply embedding mp4 files directly. You can use hls.js for hls and dash.js for dash, or video.js for both.


Thank you very much!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: