Back to blog

Prepare an AI Website Background Video for Real Pages

AI Media Generator

Prepare an AI website background video with a real four-second file, measured compression sizes, a poster frame and desktop and phone text previews.

Prepare an AI Website Background Video for Real Pages

An AI website background video needs to work with the heading and button already on the page. For our fictional ceramics shop, the heading says “Objects made to slow you down.” The button says “View collection.” Both sit on the left against a dark wall, with a cream vessel at the right. The layout looks balanced on a desktop. Crop that same artwork to a narrow phone hero and the vessel disappears, leaving a sliver of its plinth.

The example gives you three things to compare for your own page. There is a poster image, a playable four-second study and a phone layout using a separate crop. The study was animated in FFmpeg from original AI artwork. It gives us a known file and motion to inspect through the delivery steps.

Put the heading in the frame before writing a motion brief

Start with the actual page copy. A three-word campaign title can fit over a narrow strip of wall. Our heading breaks across two lines and sits above a second line of copy and a button. The white heading needs that wall for the whole shot. Place a mockup of the real text over the source still and mark the area that it uses, including where it may wrap when the available width changes. Find a separate space for the brightest object or the edge that moves.

Desktop website hero preview with a two-line white heading on the left and a cream vessel on the right

On the AI Video Generator, select a model that accepts your intended input. The checked composer showed MiniMax H3 with 16:9, five seconds and 2K selected. The Add media menu offered local files and previous content. If you have already laid out the shot around a still image, attach it to a model that accepts image input so the composition is part of the request. Check the available clip settings and displayed credit estimate before you render. The four seconds used for the delivery study came from external editing.

The motion brief can describe a lot with one change. This is how I would try the shot if I wanted movement from the curtain.

A quiet ceramics studio with one cream stoneware vessel on a walnut plinth at the right. Keep the left half a plain dark wall with steady exposure. Use a locked camera. Let the linen at the far right shift gently while the vessel stays in place. Leave the image free of lettering and logos so the heading can sit on the wall.

Place the text over the video as soon as you have a candidate. Check the middle and tail as well as the first frame. A bright fold entering the left half for half a second is enough to make the heading harder to read at the moment someone starts reading it. If the movement you want is a camera move, the camera movement guide shows how to describe the framing and subject separately.

Choose a website hero video poster frame with the page copy over it

The poster is the still visitors see before the video starts. Give it the same job as the first frame. It should establish the subject, leave space for the words and fill the same box. A close crop of the vessel would make a fine standalone product image. In this particular hero it would put a bright pot behind the heading, then jump to a much darker wall when playback started.

Poster for the ceramics hero, showing the dark wall and vessel in the same landscape composition

The 1280 × 720 poster for our study comes from the same artwork as the video. Its file is 19,654 bytes. The demonstration applies a 1.5 percent digital push with the right edge anchoring the crop. The curtain in this file is part of the still artwork. Compare the still with the start of the video so that any small difference in crop or exposure is visible during review.

Our 1280 × 640 desktop preview uses a box that is wider in proportion than either the poster or the video. At that width a centered cover crop trims 40 source pixels from the top and another 40 from the bottom. The vessel and the wall behind the words both fit. Give the poster and the moving clip the same alignment inside the box. If the page uses a different alignment for each one, the change at playback can look like a camera jerk even when the video begins on a steady frame. Keep that alignment in the handoff beside the poster filename so the preview can be reproduced.

Play the four-second delivery study.

I sampled the area under the headline in decoded frames at the start, two seconds and near the end. The same patch of wall covered grayscale values of roughly 37 to 50 on a scale of 0 to 255 across those three frames. The bright vessel sits beyond that patch. That observation helps explain why the heading stays easy to follow in this layout. It covers the sampled wall area. On another page, use the actual text and button positions and inspect any bright patch that crosses either of them.

A dark overlay can help where the copy ends up over texture or a highlight. Check it in the brightest frame and on the poster. If it has to be heavy enough to hide the art, moving the copy or picking a quieter shot may give you a clearer page. The desktop mockup uses a black overlay at 16 percent opacity. The phone copy gets a solid panel.

Compare background video readability and file size after the download

Use the result preview to download the video you intend to keep. The generator handles the creative render. The resize, codec choice and website embedding happen in an external delivery workflow. Save the original so you can compare another encode if the first delivery copy loses an important detail.

File Dimensions Duration and frames Audio Measured bytes
Source study 1920 × 1080 4 seconds, 120 frames None 1,399,539
Delivery study 1280 × 720 4 seconds, 120 frames None 58,710
Still poster 1280 × 720 Still None 19,654

Download the larger source to make the comparison.

Both MP4s are H.264 at 30 fps. The delivery copy is about 95.8 percent smaller in bytes for this artwork. The source and delivery copy are particularly simple clips made from one still. With waves, falling leaves or fabric in motion, expect to judge the encode on its own. A file of the same size might show blocky changes around the subject or banding where a flat wall should look smooth.

The external command below scales the frame to 1280 pixels wide with an even height, omits audio and moves the MP4 index toward the front for progressive playback. CRF 28 is the setting we used here. Keep the resulting file separate so you can compare it against the larger original. FFmpeg format documentation

ffmpeg -i source.mp4 -vf "scale=1280:-2" -an -c:v libx264 -crf 28 -preset slow -pix_fmt yuv420p -movflags +faststart hero.mp4

Open both copies at the actual desktop render size. In our study, look at the vessel rim, the line where it meets the wood and the dark wall near the headline. I compared the decoded delivery frames with the source frames scaled to the same dimensions. The average grayscale difference across the three sampled full frames was about one step on the 0 to 255 scale. That gives me a quick check on this encode. I would still watch a difficult shot in motion and inspect localized changes around the brightest edges.

If the rim softens too far in an encode, try a lower CRF with the same dimensions and compare the rim again. If the clip still looks good at the displayed size but transfers more than you budgeted, try a smaller target width and check the most important edge again. Change one encoding setting at a time. That way you can tell whether the difference came from reducing the resolution or from the compression itself.

Keep the file numbers separate from page measurements. The poster and the delivery video together total 78,364 bytes if both full files are transferred. A page can request both at once and also request its fonts, scripts and other images. If you want a loading-time result, measure the actual implemented page with a cold cache and a stated network profile. Look at when the heading becomes readable, when the poster appears and when the browser requests the video. A file size comparison establishes the difference in asset bytes. web.dev video performance guide

Compare the phone crop with a layout made for the phone

A centered cover crop from a 1280 × 720 file into a 390 × 560 box keeps about 501 source pixels across. The difference matters because the focal object sits well to the right. In the left panel, the plinth barely enters the crop and the pot drops out of view. In the right panel, the same heading and button are set in a solid dark panel, with a crop centered on the vessel below. Both text and subject can then use the full width.

Side-by-side phone previews with a centered crop losing the vessel and a static layout showing the copy and vessel separately

Try moving the crop toward the subject before deciding. In this scene, keeping the vessel in the video occupies the space the heading needs. The static design solves the problem by stacking the copy and subject. On your page, check with the longest real heading, the actual button label and any language variation. A ratio in the model picker describes the media. The aspect ratios and safe areas guide shows how different visible areas can result from that media. For the static design by itself, see the website hero image with room for text workflow.

Make the page usable while the video waits or stays off

Hand off the compressed video, the landscape poster and the phone still as separate files. Put the headline and button in the page itself so they can be read and used while media loads. The poster can fill the desktop hero from the start. For an intended background autoplay, use muted inline playback and account for browsers that decline a play request. Provide a pause control for moving backgrounds and keep the still available for people who prefer less motion. MDN video element · MDN reduced motion

If the phone and reduced-motion designs both use still images, the page can wait to attach the video source until it has chosen the moving layout. Check requests in the browser when the static design is selected. Styling a loaded element out of view can still leave the browser with a video to download. Also check a blocked playback path. The visual fallback should already be in place, with the same heading and button and a frame height that keeps the rest of the page from moving around.

A useful browser review is to open the page with the network panel already recording. On the static phone path, find the request for the intended still and look for any MP4 request. On desktop, note whether the poster becomes visible and when the video request begins. Repeat under the same cache and network settings after making a change to the load behavior. Check the transferred bytes as well as the file sizes, since a cached or partial response can differ from the number on disk. The outcome can then be tied to that implemented page and those test conditions.

Check on the implemented page What you want to see
Desktop before playback Poster and live text fit in the hero without a layout jump
Desktop during playback Heading and button remain readable in the brightest part of the shot
Phone layout Headline wraps cleanly and the vessel sits in its own crop
Reduced motion or rejected playback The static version stays visible and the button works
Network test The assets loaded are the ones intended for that view

Take one last pass with the real page open at its narrowest supported width. The decision for this study was a quiet moving composition on desktop and a static stack on the phone. The same video can support a different decision when the copy, crop or subject changes.