3 ms·
Video is the sort of thing that benefits significantly from economies of scale. Encoding and bandwidth costs are your two biggest factors. Encoding has to be do
by eropple 5y ago
Video is the sort of thing that benefits significantly from economies of scale. Encoding and bandwidth costs are your two biggest factors. Encoding has to be done once -- well, once per rendition you ship, more on that in a second -- but bandwidth costs are, modulo volume discounts, very linear, and thus a direct per-viewer-minute line item. Those bandwidth costs typically depend on your desired quality of video (bitrate) and capacity of service. CDNs and traditional cloud services tend to have expensive outbound bandwidth. VPSes etc. don't, but it's not fast enough to serve many users, and what happens when you hit transfer limits is Not Great.
It is pretty rare in 2021 to serve video just as "video files". HLS and DASH allow for adaptive quality streaming for bandwidth- or performance-constrained devices -- which can also help keep costs down, if you're shipping lower bitrate 480p renditions to some clients rather than full-boat 1080p -- and make resumption of partially played media easier. (Because you can append segments to an HLS or DASH manifest, you can also use this technology more easily for live-streamed content.)
This stuff is complicated. You can build out the pipelines to do this stuff yourself with either cloud services or a lot of duct tape -- I've done it before -- but it's A Lot Of Work to get right and economies of scale are a real thing. There exist services like Mux Video (YC W16, https://mux.com https://mux.com -- this is a shameless plug; I work on the devex team) package this and present straightforwardly consumable APIs for folks who just want to ship decent video at a reasonable price.
- phkahler 5y ago>> but bandwidth costs are, modulo volume discounts, very linear, and thus a direct per-viewer-minute line item We need something like bit torrent for video, where the peers send chunks biased toward the beginning of the video. This would spread the bandwidth costs to the viewers. Sure, the main site might be constantly streaming 1 or 2 full streams, but that can be fairly low bandwidth.
- eropple 5y agoIt's possible. I have my doubts, for a few reasons; as with most technical challenges, it's a deeper problem than most people realize. 1) Orchestration of this is not trivial, and creates new points of centralization. Who runs your moral equivalent of a tracker/DHT? How do they keep the lights on for your relatively niche video? There are social differences between the infrastructural audiences of BitTorrent and a hypothetical general-purpose video tracker. If the idea is that everyone runs their own, you're getting into latency-sensitive problems of coordination (and given the push towards static sites, make me ask "do we expect people to have the capacity to do this?") that strike me as tricky given the requirements of video streaming. 2) This assumes that clients are both willing and able to do peer-to-peer transfers. I wouldn't bet on it. 3) This assumes that clients keep old chunks around for the purpose of peer-to-peer transfers (and don't evict things when under memory/storage pressure) and adequately update the tracker with what it has available at all times. I wouldn't bet on that being a reasonable assumption. 4) This assumes clients are reliable and have reliable upload. If you don't get a chunk from that peer client fast enough or that client disappears before you can handshake with another one and get that chunk, you have a video drop. Video drops are a game-over condition in 2021. Which probably seems unfair to say, but something like this has to present a better solution for clients, not for content providers, and this strikes me as really not viable for clients. Otherwise, people leave. Video is really, really hard. It wasn't until I built a pipeline myself (not a fancy one, either) that I realized how nasty it was. Slinging huge amounts of data around with stiff latency requirements seems to lend itself to more vertical scaling than this approach suggests.
- ari__ 5y agoThat's actually something that PeerTube does and is enabled by default! It uses P2P Media Loader to have peers share HLS segments.