6 ms·
Ask HN: What is the most economic and scalable way to host videos in 2022?
I'm wondering what the sweet spot is nowadays as I know a couple of startups delivering video content, and at a glance it seems this is costing them more to do than it should through the Paas options they are using. I would have thought this would have improved a lot in the 10-15 years since I last looked at it seriously. I'm hoping some here know how this ought to be done on modern cloud services to enable delivering in-app videos cost effectively to large numbers of viewers. thanks!
- ozten 5y agoI don’t know how the cost compares, but a simple solution is a paid Vimeo account and then embers the videos behind a website or app that requires auth. Playback is limited to an allow list of domains.
- melony 5y agoBunnyCDN
- technobabbler 5y agoIf you don't need PPV (pay per view) or fancy monetization, you can just put them on Vimeo or even YouTube for very cheap. Or CloudFlare Stream, maybe: https://www.cloudflare.com/products/cloudflare-stream/ https://www.cloudflare.com/products/cloudflare-stream/ Edit to add: Please, for the love of god, do not self-host your video as a static file. There is a LOT of thought that goes into modern video streaming, such as on-the-fly transcoding to different resolutions & bitrates, pre-caching the next few seconds, seeking support, thumbnails, auto-captions, hardware decoder support... absolutely none of that is trivial to implement, but they make a huge difference in end-user UX. You may design your video on some sort of 5k supermac, but a lot of your viewers will be watching them on cheap Androids. The video providers spend a lot of time optimizing their streams and networks for such use cases. You will not, and your users will suffer for it, if you try to self-host. Please, please don't do this. Signed, that guy who hates it when you're expected to download a 50 meg MP4 to understand a product.
- rahimnathwani 5y ago"The video providers spend a lot of time optimizing their streams and networks for such use cases. You will not, and your users will suffer for it, if you try to self-host. Please, please don't do this." If I follow these steps, what would I do wrong that would negatively affect my users: 1. Google 'ffmpeg hls nginx' 2. Encode my video at a bunch of different resolutions and bitrates. 3. Rent a server at hetzner or wherever. 4. Install nginx and do the minimal configuration needed to serve the files I prepared. What could go wrong that would allow the video to play on a fast connection, but not on a slow connection (or slow device)?
- technobabbler 5y agoNone of this is impossible to do, just a lot more work than clicking "upload" on Vimeo and letting it take care of there rest for you, for what, $20 a month? Those 4 steps are already work that most won't bother to do. Because why? What would the advantage be? Things that could go wrong: The end-user's frontend (a 4-year-old phone browser, a crappy smart TV, a Chromecast, Microsoft's browser abortions, whatever) has to support your protocol of choice. HLS is more and more common but it's not a guarantee, whereas the Vimeo and YouTube players have years of legacy and fallback support and have their CDNs pretty stabilized. With HLS you might still need a frontend JS player and then have to manage the distribution and packaging for that. And if you care about the video player UX, things like supporting user-chosen resolutions (overriding network speed), theater mode or easy full-screen or subtitles, 1.5x+ speed, etc. And you have to invalidate and re-CDN a bunch of separate files every time your source file updates. But really, again, it's not that you CAN'T recreate what Vimeo and YouTube etc. have done, but why would you want to? It's a lot of effort to end up with an inferior UX, higher bandwidth charges, and a whole new pipeline (if not stack) that you have to maintain. No reason to reinvent the wheel for such a common use case. Edit: And you STILL have to CDN it in the end, unless you have the phattest pipes in all the worlds. So you still have to subcontract with a third party in the end. Why not just put it there to begin with? It's silly. It's one thing if you're Google-scale and need to in-house everything because you're dealing with a billion viewers a day, but when it's just a few thousand (the OP said that in a different comment), it's really not worth your time or bandwidth charges to reinvent that infrastructure.
- evv555 5y agopeertube
- moltke 5y agoIf you just want to share a video dump it in /var/www/html. If it becomes very popular you'll be able to monetize it and pay for a CDN but that kind of popularity usually has to built up to so you shouldn't worry about it if you just want to share something.
- technobabbler 5y agoYou're gonna get cut off from your host after a few hundred views, not enough for it to go viral. If you're lazy, just put it on YouTube as an unlisted video and embed it wherever. It'll be way more reliable (not to mention transcodable for different mobile viewers) than self-hosting on a web server.
- rahimnathwani 5y agoEncode it using HLS or DASH before you do that.
- robcohen 5y agoThere is no practical way to answer this because there isn't enough information. At what scale? (Netflix or a small conference with 1000 users streaming?) Do you have expertise? (Are you a kubernetes/nixos guru with extensive colocation administration experience or do you want Cloudflare Stream ease of use?) The closest thing to an answer for the MOST economic and scalable way assumes a lot of devops capability: be your own CDN.
- technobabbler 5y agoIt's unlikely a single devops person or team can scale cheaply. The big CDNs have HUGE economies of scale (read: peering agreements) that make them much, much cheaper than trying to run your own edge network. Hell, even if put your video on an established peer to peer network (similar to bittorrent streaming), the support nightmares would probably cost more than just putting it on an already established CDN. There is really no reason to self-host videos these days. They are write-once (or very rarely), invalidated very rarely, and can be trivially cached everywhere, sort of a best-case scenario for big CDNs. Even if you didn't have to touch a single line of code, trying to reestablish just the business deals yourself across many countries and data interconnects would be ridiculously expensive.
- iainctduncan 5y agogood point, will edit (edit: nope, too late to edit!). I'm talking tiny company that does not have a tech team, but is paying an all-in PaaS license for content delivery, with features I don't think they need. Looking to serve thousands, but not hundreds of thousands.
- technobabbler 5y agoCan you say which PaaS they are using? It's hard to believe any modern PaaS doesn't have video delivery included as an option of some sort. FYI we use Vimeo to serve about a million views a month, for $20/mo. It doesn't get much cheaper than that.
- iainctduncan 5y ago
- analyte123 5y agoThe answer is surely what all of those auto-playing video ads are using. Anybody know?
- technobabbler 5y agoThe ad networks probably host their own videos. It's different when the videos can subsidize themselves through ad clicks. Here's one of Google's: https://support.google.com/displayvideo/answer/6086451?hl=en https://support.google.com/displayvideo/answer/6086451?hl=en
- fxtentacle 5y agoTo me it looks like everyone is freeloading off unlisted youtube videos. Can't beat free ;) Apart from that, ffmpeg can generate all the files you need and nginx can host them, but make sure you have a hosting company with generous traffic allowance. Putting this on S3 is probably a lot more expensive than renting vimeo, which is a dedicated white label video hosting service.