6 ms·
Why are people overcomplicating web video so much? With the HTML5 video tag it's not much more complicated than serving an an <img>. You still "need" two forma
by unicornporn 6y ago
Why are people overcomplicating web video so much?
With the HTML5 video tag it's not much more complicated than serving an an <img>. You still "need" two formats, I know that sucks (but av1 will hopefully become the solution). A small to medium sized blog can just upload the files to shared hosting (or even archive.org if space is sparse). No JS, no CDN needed.
- GeneticGenesis 6y agoGreat question, it's actually not quite that simple. HTML5 was indeed supposed to bring trivial video to the browser, and it almost did. If you want a good video streaming experience for all your viewers, you need something called Adaptive Bitrate (ABR). Some protocols that you may have heard of the implement ABR include HTTP Live Streaming (HLS) and MPEG Dynamic Adaptive streaming over HTTP (DASH). ABR allows the stream to adapt to the bandwidth capabilities of the viewer. If you don't do this, some users will experience buffering, and some will have to sacrifice on quality. Unfortunately most browsers don't support an ABR format natively, so you need to use Media Source Extensions, and a more complex player to support these protocols in a browser.
- pas 6y agoWhat's wrong with buffering? Just let the client download it in full, provide a progress bar, and then allow it to watch/enjoy. Obviously it's not going to be YouTube/Netflix-level anyhow.
- black_puppydog 6y agoWell, people do expect YT/NF level. And sadly we've trained everyone to expect that everything starts playing instantly. So if your income depends on people not rage-quitting your page, you'll have to provide something that satisfies their "needs", or more appropriately "desires".
- pas 6y agoI'm not saying people shouldn't do more for user experience, but the cost-benefit seems to be bimodal. Do the minimum, or pay YT/NF/Vimeo (or CF or AWS Streaming, or get ready to bankroll your own).
- chrisandchris 6y agoSo you would like to watch that 30min 4K video on slow 2G, which then will (probably) download for 3000 hours before you can watch... Or you will just get a lower resolution and you can start watching in an instant.
- aembleton 6y agoDoes Youtube work over 2G?
- chrisandchris 6y agoWork... Yes, you can watch a video fluently, but it takes (on Desktop, Firefox, with Throttling on "Good 2G") maybe ~2min to load the video page. However, you can start watching the video before the full page is even loaded.
- Santosh83 6y agoIt is by no means a clean or modern solution (I agree, go with Youtube etc or provide a transcoding js player), but about a couple decades ago many sites would simply link to several resolutions of a video, allowing the user to play either a low, medium or high res version as per their current data connection. So that is one option that sidesteps adaptive bitrate players as well as a large CDN.
- emilfihlman 6y agoSo you'd much rather watch absolute shit for 30minutes? Yeah that's a hard no.
- chrisandchris 6y agoI agree with you - partly. It's either "watch nothing" or "watch not in 4K". Not everybody in this world has such a good internet connection. There are still enough people that would be happy to even have internet...
- ogre_codes 6y agoAs has been pointed out above, having some kinds of video downrated to be streamable on 2G isn't much different from not having the content at all. While 4K is rarely required, pushing out coding tutorials at any resolution below 1080p is nearly worthless, and pushing it out at 480p is worthless (Unless it's a retro C64 BASIC tutorial in which case rock on).
- ElFitz 6y agoWell, I don't know about you, but sometimes I'm on a 3G network. Yes, I could wait to get home. But some people also have really terribly bad providers offering them very little bandwidth. So, by doing this, you make sure your content can reach more people. Which, to me, seems to be the whole point of making and putting it online in the first place
- pas 6y agoOf course, but there are instances of the opposite. I encounter both from time to time. For example I want to show someone a video while having a drink, usually it doesn't have to be crisp 4K 60fps, just play the god damn thing before we lose interest. Other times I want to watch a video, I'm in the middle of nowhere anyway, I have time and data in the monthly cap, just not enough bandwidth. User choice and smart defaults would go a long way.
- coffeefirst 6y agoYou can probably implement a dumb version of this where transcode a few different versions with ffmpeg (which is amazing, but takes some tinkering), use browser API's to guess the right one as a default, and give the user control if they'd like to switch. I'd still try HLS but this may be good enough for v1, depending on what you're building.
- z3t4 6y agoAnd most web servers support http streaming.
- huseyinkeles 6y agoIt's easy if you want to serve the video as it is but usually that's not what you want. I have Plex (like a self hosted Netflix) on my home-server and some other people are also using it and on many different devices and connection speeds. It has to transcode the video on the fly and cache it depending on the client to have a good experience. You can't just serve 4k video to everyone.
- feinte 6y agoIf you want your content to be accessible for most people you also need to transcode your video to several resolutions. This coupled with an adaptive bitrate player [0][1] will allow clients to choose the resolution they can afford (so that people with different bandwidth can access your content) When dealing with more than 10s or 100s concurrent viewers the required bandwidth on your server will be high and putting a CDN in front may be required. [0]: https://github.com/Dash-Industry-Forum/dash.js https://github.com/Dash-Industry-Forum/dash.js [1]: https://github.com/video-dev/hls.js https://github.com/video-dev/hls.js
- lazyjones 6y ago> If you want your content to be accessible for most people you also need to transcode your video to several resolutions. Let's be more concrete. How many people will you lose today from your audience if you just offer 720p? Hard numbers please!
- niyaven 6y agoIt depends on your market. If you're aiming for people at home in Seoul, yeah that's probably alright. Their connection should be great and stable. If you're aiming at people transiting in Mumbai and watching stuff on their phone in the local train, 720p won't do.
- unicornporn 6y ago> It depends on your market. I was referring to (small and medium sized) personal blogs and websites (like the one in this post), i.e. not a digital commodity on a market. If you're out there to make money I realize you have to be more fancy with what you put out there.
- chrisweekly 6y agoNot sure it's a good idea to serve directly from archive.org
- nickjj 6y agoIf you're interested I talked to a developer at Mux (they serve billions of video views per month) about their tech stack at https://runninginproduction.com/podcast/31-mux-is-an-api-based-platform-that-lets-you-process-and-stream-videos https://runninginproduction.com/podcast/31-mux-is-an-api-bas.... Around the 1:14 mark he goes into why you can't just use the html video tag. It was one of the best explanations I've heard around HLS and what it takes to stream video efficiently.