# Landing page background video: specs, size and autoplay

- Author: RomanMotion (https://wurk.fun/user/RomanMotion)
- Published: 2026-10-20
- Canonical (HTML): https://wurk.fun/blog/landing-page-background-video-specs-size-and-autoplay
- Cover image: https://ik.imagekit.io/wurk/browser-uploads/f1c626b5c17e7f0a61dfbbe7a20d85ae7b33a20527243aeec2ee1d0a8b87562a/98f83719-5266-4c31-ae6c-2677109753e4/cover-bg-video.jpg?wurkUpload=v1.wYonpVY_cCukn45fCZMSf4cHcK_enhfLLEpEmJlahiI

---

A landing page background video autoplays reliably only when it is muted, has the playsinline attribute for iOS, and ships with a poster image, because every major browser blocks autoplay with sound (MDN's autoplay guide spells out the rules). Keep the file to a 10 to 20-second loop, 1280 to 1920 pixels wide, under about 3 MB as H.264 MP4, and respect the reduced-motion setting. That is the whole recipe; the rest of this guide is the details and the code.

## The HTML that works

```html
<video
  class="hero-video"
  autoplay muted loop playsinline
  poster="/media/hero-poster.jpg"
  preload="metadata"
  aria-hidden="true">
  <source src="/media/hero.webm" type="video/webm">
  <source src="/media/hero.mp4" type="video/mp4">
</video>
```

Why each attribute is there:

- muted: browsers allow autoplay without a user gesture only when the video is muted. Without it the video shows the first frame and stops.
- playsinline: iOS Safari otherwise opens the video full screen when it plays.
- loop: a hero video should never reach an end frame.
- poster: shows while the file loads and is what slow connections see. It is also what reduced-motion users see if you pause the video.
- preload="metadata": the browser fetches enough to know the size, then the autoplay triggers the full download. On very large files consider preload="none" with a scripted play.
- aria-hidden: a decorative video has no information for screen readers; the real content is the text beside it.

## Reduced motion

Some people turn off animation at the OS level. Respect it:

```css
@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
  .hero { background-image: url(/media/hero-poster.jpg); }
}
```

Or pause with a line of JavaScript when the media query matches. Either way the poster carries the look.

## File specs

| Setting | Value |
|---|---|
| Length | 10 to 20 seconds, cut so the last frame matches the first |
| Resolution | 1280 x 720 for most heroes, 1920 x 1080 if the video is the whole screen |
| Codec | H.264 MP4 (works everywhere) plus VP9 or AV1 WebM for browsers that take it |
| Bitrate | 1.5 to 3 Mbps for 720p; aim for a file under 3 MB |
| Frame rate | 24 or 30 fps; 60 doubles the size for no visible gain in a background |
| Audio | Remove the track entirely; a muted track still adds bytes |
| Poster | JPG at the same aspect ratio, under 150 KB, the first frame of the loop |

A command that produces a good MP4 with ffmpeg:

```
ffmpeg -i source.mov -t 15 -an -vf "scale=1280:-2,fps=30" -c:v libx264 -crf 26 -preset slow -movflags +faststart hero.mp4
```

The -movflags +faststart part moves the index to the front of the file so playback starts before the download finishes.

## Mobile: serve a smaller file or none

On a phone a hero video costs data and battery and often covers the headline. Two reasonable options:

1. A smaller file via a media query and a script that swaps the source below 768 px.
2. No video on mobile: hide the element and show the poster. This is what I do on most client pages.

## What to put in the loop

Background video is decoration, so it should be quiet. Slow movement, low contrast, no text inside the video (the headline sits on top of it), no cuts that pull the eye. Product UI loops work if they are slowed down and darkened by 30 to 40 percent so the headline stays readable. Check contrast with the text over the busiest frame.

## Performance checks before shipping

- Lighthouse on mobile: the video should not be the largest contentful paint element. If it is, the poster is missing or loads late.
- Total hero weight under 4 MB including the poster.
- Test on a real phone over cellular, with Low Power Mode on (iOS pauses autoplay in Low Power Mode; the poster must look fine on its own).
- Test with the sound switch on; nothing should play audio.

## When to skip the video

If the product is visual, a 15-second screen loop above the fold does a job a screenshot cannot. If the product is a spreadsheet or an API, the video is a weight cost with no message; use a static screenshot and spend the effort on the headline instead. [Above the fold: 7 fixes that lift signups on an indie landing page](https://wurk.fun/blog/above-the-fold-7-fixes-that-lift-signups-on-an-indie-landing-page) covers that part.

Related reading: [How to make a product launch video: the 3-video set](https://wurk.fun/blog/how-to-make-a-product-launch-video-the-3-video-set) for the footage the loop comes from.

## FAQ

**Why does my background video not autoplay?** It is almost always missing the muted attribute, or missing playsinline on iOS. Browsers block unmuted autoplay without a user gesture.

**What size should a landing page background video be?** 1280 x 720 for a hero section, 10 to 20 seconds, under about 3 MB as H.264 MP4 with the audio track removed.

**MP4 or WebM for a website video?** Ship both: WebM (VP9 or AV1) first for smaller files in browsers that support it, MP4 (H.264) as the universal fallback.

**Should background video play on mobile?** Usually no. Hide it below 768 px and show the poster image; it saves data and keeps the headline readable.

**How do I stop the video from slowing the page?** Poster image, preload="metadata", faststart flag, file under 3 MB, and no video on mobile.

**Does background video hurt SEO?** Only indirectly, through slower load times. A properly compressed, lazy-loaded loop with a poster has no ranking effect of its own.

If you need the loop and the page built together, the launch kit on my store covers the landing page plus a 15-second teaser cut for the hero: https://rmgo.sites.tab.bot/kit?s=blog
