9 ms·
> We’ve had the HTML <video> element for over a decade. Yet, everyone still defaults to embedding YouTube frames instead of hosting their own videos. The underl
by pwdisswordfish8 5y ago
> We’ve had the HTML <video> element for over a decade. Yet, everyone still defaults to embedding YouTube frames instead of hosting their own videos. The underlying problem is that the <video> element isn’t suitable for embedding short video files on webpages.
The reason small websites prefer YouTube embeds is because they want to avoid bearing the storage and bandwidth costs of serving it. And the logistical costs of transcoding it to N different resolutions times M different codecs. No amount of improvements to HTML alone will change that. (Not that the changes are entirely worthless, but they still do not and cannot address the real issue.)
- nathanyz 5y agoExactly correct. Video is on a different level of cost/complexity than images, html, etc. Video is not one of those things you can have your build pipeline automatically optimize for you as part of deploy (well at least not if you want deploys in a reasonable amount of time). Disclaimer: Founder of service that lets you use <smartvideo> tag with raw, unfiltered videos, and automatically turns them into optimized, streaming, cdn enabled playback.
- cpach 5y agoGood point. YouTube isn’t the only game in town though. There are competitors such as Mux and Wistia.
- anaganisk 5y agoYoutube is free vs others which are paid. And youtube is the most known video hosting service while I have barely heard of others. Are they really competitors?
- d2wa 5y agoTwitch is free and quite popular. Everyone hangs out on Daily Motion, Vimeo, Cinnamon, D.Tube, and PeerTube all the time. Right?
- stevehawk 5y agotwitch isn't a video hosting service. it's a streaming service
- oarsinsync 5y ago...with on-demand replays of previously streamed content.
- anonymfus 5y ago...which expire in two weeks (or 60 days if you are rich) so only few minutes of highlights remain.
- anaganisk 5y agoWhich everyone are you talking about? 99% of youtube users probably never heard of those services.
- chrisweekly 5y agoVimeo would've been 1st on my list of yt alts
- d2wa 5y agoIt’s not just small websites, though. Government information websites use YouTube too. Even activist websites criticizing the tech monopolies host with YouTube embeds. Even the distributed web/P2P platform IPFS hosts videos on YouTube instead of using it’s own P2P stack. Anyhow: the point was that it’s too difficult to embed videos even if you’re willing to bear the hosting cost. It costs roughly 0.0015 USD per hour video in 480p/VP9 hosted with BunnyCDN. The cost is manageable.
- csmpltn 5y ago> "It costs roughly 0.0015 USD per hour video in 480p/VP9 hosted with BunnyCDN. The cost is manageable." while True: downloadVideoFromDW2A(); Good luck managing this.
- account42 5y agoHow is that inherently harder to manage than while True: downloadIndexHtmlFromCSMPLTN();
- BiteCode_dev 5y agobandwith
- csmpltn 5y ago> "bandwith" Leave it to HackerNews to downvote the only sensible answer in this thread, rooted in a simple technical understanding of how distributed caching works.
- innocenat 5y agoIt's probably not downvoted because it's wrong, but it's because it doesn't help anyone who don't have "simple technical understanding of how distributed caching works."
- thewakalix 5y ago
- acdha 5y agoThis is correct. I’ve written the JavaScript to select sizes dynamically – it’s 599KB smaller than the 600KB claimed. The hard part is the transcode infrastructure, and that’s frequently unnecessary for the small videos: if you use multiple sizes and formats, you increase the amount of traffic you need to see cache hits. YouTube has built a ton of infrastructure but most sites won’t see enough return to be worth the ops cost.
- ddaalluu1 5y agoI blame Google for making mpeg-dash so inaccessible. Want/need to use DRM? You won't receive a response from Google/widevine, no matter how often you write to them, despite them claiming otherwise and no matter how much money you already earn them via their advertising network. They have the defacto monopoly and they want to keep it.
- hyproxia 5y ago>Want/need to use DRM? You won't receive a response from Google/widevine Thanks Google!
- Uehreka 5y agoThis doesn’t mean DRM is impossible, it means it’s only available to really big players who can cut deals with Google. Which makes it one of the few parts of the Web API that smaller companies and independent devs can’t use (not that I’d personally want to). Keeping it tightly controlled like that also makes it harder to crack.
- hyproxia 5y ago>Keeping it tightly controlled like that also makes it harder to crack Can you elaborate?
- no_time 5y ago>Keeping it tightly controlled like that also makes it harder to crack. We both know that's BS. I never thought I'd say this but Google is doing good by not selling this "product" to anyone that just asks.
- magicalist 5y ago> They have the defacto monopoly and they want to keep it. FairPlay and PlayReady are there too.
- ddaalluu1 5y ago
- achairapart 5y agoAgree with your points, but the HTML5 video tag is still broken. For example, on many browsers (Chrome and Safari at least) if you put a video on loop, with certain sizes, the internal logic makes it re-download the same video ignoring any server cache headers. That's it, if you leave a browser open with the same video in loop, it will suck your bandwidth forever. I think the same happens if you seek through video playback. To avoid this you need to put in some javascript that preload the whole video and make it a blob, or something similar.
- RNCTX 5y ago> That's it, if you leave a browser open... it will suck your bandwidth forever. Funny you mention that, google / youtube does the same thing to jank'ify its own user metrics on my laptop, regardless of whether it's a 5 minute video or a 3 hour video (by auto-playing the next one). Even if the laptop is asleep.
- esnard 5y agoCan you elaborate on the "with certain sizes" please? If the video file is something in the tens of GBs, it would be quite understandable for the browser to avoid keeping the whole file in memory.
- d2wa 5y agoDisk caching is still a thing. Kids watch the same videos on repeat for hours on end, so maybe almost-indiscriminately caching the entirety of the last watched video would be a good idea.
- lxgr 5y agoOn the other hand, in a typical Netflix binging scenario, this would cause tens of gigabytes of avoidable SSD writes. Especially for mobile devices with fairly small storage sizes, this can easily represent a sizable fraction of their total write endurance.
- 5y ago
- claudex 5y agoEven without the storage/bandwidth problem. Why develop internally a system to upload and distribute video which will have, at best, the functionalities YouTube provides for free. The day YouTube will charge for the embedding, a lot a website will find something like. Like a lot of website started using a solution based on OpenStreetMap when Google maps changed its pricing.
- 323 5y ago> The reason small websites prefer YouTube embeds is because they want to avoid bearing the storage and bandwidth costs of serving it. YouTube also works 100% of the time. I've encountered countless other sites, including major ones, like CNN or The Guardian, where half of the time video doesn't work, or it's terrible in some way (impossible to seek or pause, ...)
- MayeulC 5y ago> And the logistical costs of transcoding it to N different resolutions times M different codecs. If only we had easy access to scalable video (SVC). If a container format supported it, the web browser could perform range queries to get the interesting bits as needed, no need for additional code. And the uploader would need to transcode only once. This doesn't solve the codecs issue, but I think you could get away with offering one or two common codecs.
- michelb 5y agoOne of the many reasons I use YT or Vimeo is that I simply upload the high-res render, edit some metadata and I'm done with a simple embed in most cases. Alternate versions for lower bandwidth are automatically made and automatically served, streaming is taking care of (YT really excels here), and there is a nice API to do interactive stuff. I do use the <video> element from time to time, but only if I want to optimise the loading of an autoplaying video or there is some other technical reason.