TL;DR
CDN Hosting
Using a Content Delivery Network (CDN) is one of the most effective ways to improve video loading speed. CDNs distribute content across multiple servers, reducing load times by serving videos from locations closer to the user [1:3]
[2:7]. Services like Bunny.net, Mux, and Cloudflare are popular choices for video hosting
[5:1]
[5:2].
Video Optimization Techniques
Optimizing video files is crucial for improving load speeds. This includes compressing videos to reduce file size and using modern codecs like VP9 or H.265 [4:1]. Additionally, setting preload attributes to "none" can prevent videos from loading until necessary
[4:1]. For background videos, using a lightweight screen capture as a fallback image can help maintain visual continuity while the video loads
[3:1].
Lazy Loading and Adaptive Streaming
Implementing lazy loading ensures that videos only load when they come into view, which reduces initial page load time [1:2]. Adaptive streaming, which adjusts video quality based on the user's connection speed, can also enhance performance
[2:5]. Using tools like Intersection Observer can help manage when videos start loading or playing
[4:1].
Considerations for Video Hosting Platforms
Choosing the right video hosting platform is essential. While self-hosting offers design flexibility, it can strain server resources, especially with multiple autoplay videos [4:5]. Offloading videos to platforms like Vimeo, Ignite.Video, or Bunny Storage can alleviate these issues
[2:5]
[4:7]. It's important to test video components across different browsers to ensure consistent performance
[5:1].
Additional Tips
For sites with heavy video usage, consider the impact on network bandwidth and CPU load [4:5]. Also, be aware of browser-specific behaviors, such as iOS pausing autoplay videos in low power mode
[4:6]. Regularly assess your site's performance metrics to identify areas for further optimization.
I hired a development team to custom code my website. For the backend development they asked me the following question
Developer: you already have this option in admin panel, just tell me one thing, which format you will use? embedded videos (which will save website load time) or you want to upload mp4 format from backend? please confirm/
Is this true? Because if it wouldn’t really effect load time I would rather upload mp4 myself but if it would save load time than it probably more important
If this is a WordPress driven site, you can easily use the preload=”none” variable in the shortcode for remote hosted videos. I'm not sure it works the same for self-hosted.
If it's self-hosted, just add in a lazy-load plugin, and the videos will queue but not load until they come into the viewscreen.
Offload your video files / Images to a CDN. Will drastically improve load time.
It reduces server load which will result in lower load times, this is why many sites use CDN’s for media content
So would you recommend using Vimeo? Or something else?
It helps improve the load speed to use a third-party service, but make sure that it's a good one. Otherwise, you will see that your website pages load slowly again.
In my experience self hosted videos slow load time unless they are very short (a few seconds) . Longer videos take longer to buffer resulting in longer load times.
I just started using the new video option on cloudflare and switched from a self hosted to hosted on their streaming platform. It seems to work well.
Hello Devs,
I recently got a website designed from a team but they seem to lack the knowledge on delivering with the tweaks and optimizing. So I thought of asking the experts here, getting some help.
In the new website, the Homepage Hero section is a Full page video on loop. Having it hosted on the webserver and loading the website takes a longer time and not giving the experience I want the users to have on the first-load.
But I've also seen some really nice websites that have the Hero section video and without much issues as well.
Noticed that BunnyCDN has Optimizing features and also more features such as "Stream" and etc. But I'm not that familiar or even not sure if this is the best way to render or deliver these videos to the users.
What's your take? Layman's terms, please?
It's me again - now almost done with the website.
I noticed this website smooth playing the Video on their Home-Hero section
How do they do this?
How to did you fix this where uploaded photos and videos? Which storage and which can you used for website ? Any cost analysis you did and how much total GB or TB for data you have I am creating similar site for event I am curious to understand pricing and solution. For my future project
Yes - after many attempts to find this information, I was able to get an answer.
The faster website is done using MP4 Fallback. It's basically linking the video from a Faster storage to mine.
I used Bunny Storage and linked. Oh boy - it's fast. I think that the same which the above example also did - just with AWS.
It's a combo.
The video has to be optimized carefully. Aside from compression, sizing, and format, even the content itself matters. Usually it's done so to be slow motion or non moving much for the first 3 to 7 secs. This is to allow lower bitrates to smoothly deliver and to not skip frames and deliver smooth seconds to make the video effectively be able to create buffer for the rest. These days some pages won't even bother, but it all depends on your audiences target connection/device.
I've personally found that S3 from amazon does already a good job even on free tier, as long as the bucket is close to the audience.
The 'stream' bit, there's nothing magic to it, you can basically encode the video on a format that supports that feature out of the box within the static file, like mp4 or webm. There are surely more sofisticated ways powered by serverside, but for something like this I feel is an overkill. Normally it does the job fearly well.
Size the video a bit smaller than what you need and resize it to the viewport via CSS, accept that it won't be fullHD for everyone, provide a smaller version to mobile devices, all small tricks in the hat to improve the thing.
This ⬆️
Or If you don’t want to wrangle infra: use a video host that gives you adaptive streaming + a clean embed / or the m3u8 master playlist. Drop that stream into a lightweight player (native <video>) and you’re done. But comes at a price compared to to s3 bucket + cloudfront. Bunny, Mux, Ignite.Video, yeah even Vimeo, ...
Yah, hence my second to last paragraph. Overkill for a small startup on a fairly small amount of traffic and a short and probably small meaningless video background thing. Those are big guns for big boys with big problems, and can be brought to the table when you need to ratchet up the simple solution, because management decides the video HAS to be delivered at HD, or because CloudFront and S3 can't keep up, or because the video HAS to trigger epileptics and they have money to throw at this issue.
You could even throw cloudfront in front of that bucket to make it even faster
Aye. Every millisecond matters here.
Hey! I have a video for my landing page and it is being hosted on Youtube. I noticed that when the webpage loads it takes a while for the video to load. How can you optimize videos? There is so much information about optimizing images on a website but it's harder to find information how to optimize videos for speed.
Honestly, it loaded pretty fast. Maybe use a screen cap of the first frame of the video as your background image so it transitions better from grey to video.
Also, further optimization to reduce file size. I'm not expecting 4k crystal clear video on a hero video like this as a customer.
What do you mean by using a screen cap as the background image? Right now I have a background video, how can I use both?
There is a Background Fallback option when you're adding a video. You can set an image if the video doesn't load. This is effectively a background-image in CSS and will default load while your video is getting ready.
So make a super lighweight screen cap of the first frame of your video (say 20kb) and use that. It'll load first, then your video should load and play once its ready.
There’s resources out there that can help reduce the size of the video. For instance I will compress my 10mb videos down to about 1-2mb. My quality is greatly reduced, but if you slap a #242424 .80 opacity overlay you won’t tell the difference.
Hey there, /u/szuu123! If your post is not already flaired, please add one now.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
CDN
I’ve built many websites with videos, mostly for content like blog posts, but never to an excessive degree. In those cases, additional optimizations for video elements weren’t necessary, as most clients rarely published content with videos. When they did, it was usually just one video with controls, not something that required complex optimization.
However, the current project I’m working on is different: it includes videos as design elements across multiple pages, with five autoplay videos on the homepage alone. While my colleague optimized the videos for duration and file size (about 10MB each), I still have some concerns.
The site is optimized for speed, hosted on a dedicated server, and has videos set to lazy-load. So far, performance has been fine, but I’m starting to question whether this approach is considered a bad practice in web development.
I’ve seen suggestions that embedding videos from other platforms might be better for performance, and while that sounds logical, I prefer hosting them directly and embedding them using the video tag for more control over design and functionality. Given this approach, what key factors should I consider to optimize the videos?
I’d also like to know if the approach of using so many videos per page is generally frowned upon among web developers. In that case, I’ll definitely inform my designer and client and suggest making some changes.
Compress them as much as you can. I think you can compress them more, by using the correct compression settings. Make sure the videos are cached properly and that the catching settings are correct. 10mb per vid is still a lot if each user is pulling 40mb.
Otherwise you are going to get a horrible horrible bill.
you can actually host them on a video hosting service and with a bit of trickery hide the logos.
My colleague, who handled both shooting and editing the videos, ensured they were compressed as much as possible, which I really appreciate. Caching has also been properly optimized. While hosting them on a video service seems like a logical choice, which platforms are generally considered the best option among web developers?
First, be aware of how browsers treat autoplay videos
https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Autoplay
Next, are you prepared for the network bandwidth to support self-hosting videos with five users? 10 users? 100? What is your projected user load? Video can also put a significant load on your CPU, depending on how you manage it.
In most cases, it's going to be best to offload video to a video hosting service
Regarding autoplay across different browsers, I made sure the videos themselves have no audio and use the muted attribute.
However, I haven't tested the autoplay function on all the videos across all browsers yet, so thanks for the heads-up!
So far, there are no issues on Chrome (desktop, Android, and iOS) or Firefox (desktop).
As for the bandwidth consideration, it's so obvious, yet it didn’t even cross my mind! Thanks again, I’ll definitely look into that.
Be aware of iOS pausing autoplay videos when the device is in low power mode. There is no way around this so you should just be aware and always optimize the poster image.
If ur customer really wants this madness just ensure that the videos are streamed. With your own server adaptive streaming looks impossible.
They specifically requested it and absolutely love the design and concept. With this project, I wasn’t involved in the early stages and was handed the approved design to start building. If I had been involved earlier, I would have advised toning it down a bit. For now, I’ll focus on offloading the videos elsewhere.
I hope all 5 videos with sound on 😏
Now that you mention it, I’m curious about how the combined audio output would sound, especially on the 'Projects' page, where even more videos are playing. I might even add an Easter egg to enable all the sounds at once—though I’m not sure the client would approve!
Hosting your own videos gives you more design flexibility, but five autoplay videos on a homepage can start to impact performance, even if they're lazy-loaded and optimized for file size. To improve efficiency, make sure you’re using modern codecs like VP9 or H.265, setting preload=""none"", and offering multiple resolutions through <source> tags so browsers can pick the most appropriate version. Using Intersection Observer to load or play videos only when they’re in view can also make a noticeable difference.
If managing all of that manually becomes too time-consuming, Cloudinary can take care of the backend stuff—automatic transcoding, resizing, and adaptive delivery over a CDN—while still giving you full control over how videos are embedded and displayed. It’s a solid option if you want to keep things custom without compromising on performance.
I have both background videos, background images but also normal images and videos. Besides the video background of the hero, would it make sense to client load the rest of the videos in the website or no? I’m trying to get a better performance score
upload to something like bunny.net and use hls.js to stream the video in. you'll have to have a bit of a play about with the settings to force it to load enough to play without pixellation, but it'll make it barely worse than a hero image
For videos, preferable use videos with a duration like 15-30 seconds and converted to webm.
Does Astro have anything built in?
bunny.net
I recommend having the video on a cdn, I use mux video, then have a cover image for the video if it the video component which loads a optimized image until the video is ready.
You probably want to test out the video component on multiple browsers as last time I worked with them some browsers acted differently.
I believe google sees lcp for video as first frame or cover image.
So far I have not found the best way to have background videos load fast, especially on mobile.
Videos have great size, usually under 3 MB, lower frame rate etc. I have hosted them on the web server, on Amazon S3, on CloudFront, but some times they take 10sec to load on mobile (Wifi).
Any hints?
Thanks!
Vimeo
As a background for the hero section? Interesting.
Just found this
https://freshysites.com/web-design-development/adding-vimeo-video-backgrounds-to-divi-theme/
Is that the way you use it?
It’s the way I would, but it may not be the best way
what's wrong with vimeo or YT (or vimeo better?) curious.
Curious how you do it.
Why not use YouTube?
You need some compression with a good D2F ratio.
Minimize file size will be the biggest thing for load time if self hosting . Hosting on another platform would cover that issue. I’m using wistia and YouTube depending on how I need the layout to work.
A website containing too many videos.
I want only the low quality version of the videos to be displayed when the user's Internet speed is low, and the high quality ones to be displayed when the Internet speed is good enough. To put it simply, the quality of the video depends on the Internet speed.
Should I have to upload 360, 480, 720 versions of the videos myself, and switch between those, if so, how? Are there any other ways to achieve so?
you dont have to manually juggle all video versions yourself the usual way is to use something like adaptive bitrate streaming with hls or dash which automatically switches between qualities based on the users internet speed platforms like youtube or vimeo use the same idea if you host yourself tools like ffmpeg can generate multiple quality versions and a video player like videojs can handle the switching,
tip: make sure to check compatibility with different OS.
This is something we did at my previous company. We started out with different mp4 files for each resolution and then started migrating to HLS, but faced performance problems on low end devices. Then we went with cmaf which increased performance on low end devices by a lot and also saved a lot of bandwidth.
> Should I have to upload 360, 480, 720 versions of the videos myself, and switch between those, if so, how? Are there any other ways to achieve so?
Doing it explicitly yourself, no. You should have something that takes in the source video and then sets up a background job to transcode that to the different file formats and sizes.
It's possible to do it on-demand (to save space) but the problem is you now need specific CPUs, a GPU, or specific transcoding hardware. With how cheap HDDs are it's a lot cheaper to just save the movie in multiple sizes.
Just use YouTube, the embed player is quite customisable. I think they have an sdk but not used it in ages.
What you're talking about is "adaptive bitrate streaming". Typically this is done with a protocol like HLS, where a video is broken into chunks and each chunks has multiple versions at different levels of quality. The player code automatically switches as network conditions change.
It's possible to implement this yourself, but I'd recommend using an existing service unless you have a very special use case. I use BunnyCDN and I've been pretty happy with their offering, but lots of companies (Cloudflare, etc.) have products in this space. You upload your videos and then they give you an iframe (or JS library, etc.) that you can embed on your site to show the video.
Thank you for the answer! You mean, I can upload my videos there on Bunny, and then use the iFrame it gives us? Is that all the process? It seems like there is no free option, because Bunny has paid plans as well.
Yes, you upload the video to Bunny and then put the iframe tag they give you onto your website. You do have to pay for it, but if you host the videos on your own server you'll likely have to pay bandwidth charges there as well. Hosting large amounts of video is never cheap.
Greetings,
I'm fairly new to this web hosting and currently using wordpress with woocommerce. Hosted at siteground. I set up it with cloudflare(siteground was suggesting it to make it faster CDN) . it takes 20s to fully load my website and i dont know why. also tried gtmetrix result was 20s also.
PS: i have startup plan in siteground
Edit : Wow autoptimize really works. Thanks for the help guys.
You could try doing these steps and see if it improves:
Install Autoptimize plugin(free) then
Then install WP Rocket(paid) and
I've never worked with Autoptimize before, but it seems like WP Rocket can achieve the same (and more), so I'd suggest going with just one plugin, which is WP Rocket in this case.
OP: Here's a very detailed tutorial on how to optimize your website: https://www.youtube.com/watch?v=zDix8THVpA8
What usually makes Wordpress slow is huge amounts of poorly made plugins. Try disabling the ones you don't necessarily need, or turn them off one by one to see which ones have the biggest effect on your loading times.
Without more details it's hard to pinpoint a single cause, you'll have to try different approaches to see what works, or diagnose it more in depth.
Do what /u/TheNominated said and only use plugins that you absolutly need.
If you want to make sure your hoster is not the problem, you might want to install a fresh wordpress in a sub directory if that is possible on siteground. If a fresh wordpress still takes 10 to 20 seconds you might want to look elsewhere.
WooCommerce means shop means complex. If you're running something like this always, really ALWAYS, use caching. Get yourself a full page caching plugin. Im using "WP Super Cache" but i haven't really tried others and there might be better paid options.
If your page content loads in a reasonable amount of time, but you are getting a "still loading" icon for about 20-30 seconds, double check that your page isn't linking to any dead images.
Chrome -> hit F12 to bring up DevTools -> Network tab -> make sure nothing is colored red. A dead asset will cause pages to take awhile to finish loading.
thank you for your input guys, will definitely do all your suggestions.
Hi guys,
My site has a lot of portfolio videos and I am using the native Carrd video player. Unfortunately this causes the site and specifically the videos and images to load slow. They are not particularly heavy as files. Do you have any tips on how I can optimize the site to decrease the loading times?
You could try using Bunny.net for video hosting (aff ink). It's paid, but very cheap (I'm paying $1/mo for one site). The benefit is faster performance and more control over the player UI (no promotions, unlike YT).
can u try using youtube embed? i believe youtube has done a lot of optimzation
I used divi and the score in PageSpeed Insights it's very low and I don't know what plugin I should use to solve this problem. If someone want to check the site, ask me (I'm not sure If I can post it here). Thank you in advance.
Run a scan at gtmetrix.com and see what it says. Sometimes it's not as simple as 'installing a plugin.'
Usually when I see super slow Divi sites it's because:
I use WPRocket. Also get a plug-in to serve images as webp. I use imagify.
Couple of plugins I would recommend are:
How to improve video loading speed on websites
Key Considerations for Improving Video Loading Speed:
Optimize Video Format:
Compress Videos:
Implement Lazy Loading:
Use a Content Delivery Network (CDN):
Enable Browser Caching:
Reduce HTTP Requests:
Optimize Hosting Environment:
Recommendation: Start by compressing your videos and using a CDN to distribute them. These steps can significantly enhance loading speeds and user experience. Additionally, implementing lazy loading can further optimize performance, especially for pages with multiple videos.
Get more comprehensive results summarized by our most cutting edge AI model. Plus deep Youtube search.