1

Please, I need your help. I'm dealing with a background video for our homepage. This section has 100vh and is full-width. I'm using DIVI as a builder.

We hired a professional videographer to record a video for us. Now he asks me what should be the ideal:

  • frame size

  • frame rate

  • codec

  • file size

I've done some research and it seems like that the ideals are:

  • frame size: 1280 x 720

  • frame rate: 30FPS

  • codec: I don't know

  • file size: the less the better

Please, does anyone have any experience with background video? I'm pretty lost.

Also, would you upload it in the WordPress media library or would you use Vimeo/YouTube? I think you can't use YouTube as a background video, correct?

Thanks a lot!

2 Answers2

1

Frame size: 1280 x 720 (=720p) means HD quality, which is quite good, but it is rather up to you, what quality do you find acceptable. Often 1920 x 1080 pixel (=1080p, fullHD) is used for background videos, like my main background video source is https://coverr.co/ where you can download free videos, specifically made for the purpose of being background videos. Those are 1920 x 1080 big. I would say, if you can ask for multiple files, ask for both, 720p and 1080p quality to be able to make a good decision.

The file size is connected to this, so the smaller frame sized video you will use, the smaller file size you will get.

Frame rate: You could take a look at this image: https://miro.medium.com/max/1300/1*uMlkXIMNF4VIZoi85NZ3aQ.png to see what it means.

Movies on blu ray, dvd and cinema use 24 FPS, so that should be enough for you too. Here as well, the lower FPS means less filesize.

Codec: h264

I'm a WordPress plugin developer and we always suggest this, when our users cannot figure out how to create a video, that plays on all browsers. So far it worked out well for everyone.

YouTube vs Vimeo vs MP4: By default you cannot make Youtube videos to be backgrounds. There are some coding tricks, which might works, but I wouldn't suggest it.

Vimeo only allows background videos for Pro Vimeo users.

Using mp4 is simple, and also it works better in mobile and tablet devices. Some devices are opening up their Vimeo/Youtube applications automatically, when a Vimeo or Youtube video is started on a website. This is quite bad and your page will end up without background.

You should also note, that most browsers (even on desktop) only allow you to play videos automatically, if you will mute the video in the html code: https://www.w3schools.com/tags/att_video_muted.asp

Mowar
  • 402
  • 4
  • 9
  • Hi, thanks a lot for your detailed help! Totally got your points regarding Size, Rate & Codec. Regarding the YouTube Vimeo MP4 - Do you think that the ideal is Pro Vimeo? Our video will be hidden on phones and tablets - sorry forgot to mention that. It seems to me that Vimeo Pro is the best solution. – David Pokorný Nov 05 '21 at 09:36
  • It depends on the size of the video and the speed of the server. For example from CDN servers you can serve mp4 files quite fast, so it wouldn't really make such a difference to buy a Vimeo Pro account. But if you feel like the video is slow, Vimeo should be faster. Then you would need a code like this: https://stackoverflow.com/a/37309881/2160907 and the Pro account would give you the option to remove controls. First I would suggest trying out the mp4 html video, to see how fast your page will be that way. – Mowar Nov 05 '21 at 10:07
  • Ok great thanks, as a matter of fact, I've just found out a solution how to upload a background YouTube video with hidden controls and any youtube related settings. I'll display no controls + add pointer-events: none; to prevent any settings to appear on hover. Then I can upload the background YouTube video and just add some negative margin to hide controls that appear before the video plays. Thanks heaps! – David Pokorný Nov 05 '21 at 10:23
0

What @Gabor said.

  • 1080p (1920 x 1080) is a good resolution for desktop.
  • If your user is on a mobile or other small-form-factor device it would be good if you could have the choice of 720p (1280x720) or even 360p (360x640). Those will save data downloads and fit the smaller devices. Look for a plugin that delivers the appropriate size video. You'll need a video file for each resolution.
  • Or don't show background video on users' mobile devices.
  • In your design think through what will happen in portrait mode. You probably want to clip off the right and left sides of the video material, so the center part fills the screen. So, the action should be in the center.
  • Is this video huge? Does it play for many minutes? If not, you absolutely should host it on your own site. Why get involved with, and pay for, some third-party media service if you don't have to? If it's really large (> 10MiB or so) you probably should ask another question and give more details.
  • Put no audio tracks in your background video files. Browsers restrict the playing of audio in background video, so there's no need to make your files fatter with audio tracks that won't play. (If you have audio, consider hosting a separate file to send users who click on the video to view it; most users won't.)
  • Use .mp4 files with H.264 video in them (one file per resolution). Other stuff, like webm with vp8 video, might generate smaller file sizes. But they don't play in as many makes and models of browser (I'm looking at you, Apple Safari.)
  • The video, in H.264 parlance, should be coded in the so-called Constrained Baseline Profile. It saves power when played on mobile devices and works better on slower devices.
  • Ask your videographer to give you streaming mp4 files (also known as fragmented mp4): they can start playing as soon as the first frame is downloaded.
  • Ask your videographer for advice about file bitrate. Your 1080p files should look decent coded with variable bit rate with a target of one megabit / second (8 seconds per megabyte). Your lower-resolution files will need a smaller bitrate: that's the point of them after all. But, your bitrate may vary. Action/adventure movies need a higher bitrate to look good than do talking heads.
  • As @Gabor mentioned, 24 frames/sec should be fine. 15 frames/sec is marginal. Ask your videographer what looks best for the material they created for you. Sometimes material shot at 30 frames/sec looks choppy at 24. (The way H.264 video works, once you get below 24 frames/sec the savings in file size aren't as dramatic as you might guess. 15 frames/sec takes more than half the file size of 30 frames/sec.)
O. Jones
  • 103,626
  • 17
  • 118
  • 172
  • Wow, this is pretty detailed thanks a lot! Our video will have 12-15s max so I don't think the file size will be bigger than 10MiB. But I'll check it out with the videographer. How is it with the codec and Constrained Baseline Profile? Is this something I need to do, or can I ask the videographer to do it? Thanks a lot for the frames. I'll definitely ask the videographer to compare the versions. – David Pokorný Nov 05 '21 at 10:13
  • Your videogrqpher sets bitrate, framerate, profile, file format (streaming mp4), and codec (H.264) when "exporting" the file for you. And, I updated my answer to mention bitrate. – O. Jones Nov 05 '21 at 10:16
  • Okay good thanks! We might actually go with a youtube background video. I've found a solution on how to display it properly without any controls or whatsoever. Do you recommend these kinds of settings even for youtube? Bitrate, frame rate, codec etc – David Pokorný Nov 05 '21 at 10:37
  • If you upload to YouTube -they will re-encode the video and framerate/bitrate/codec are done by them. If you "hide" the video for mobile - it *may* still be downloaded. Better to remove the video tag than use CSS to hide. – Doug Sillars Nov 05 '21 at 17:38
  • Right, @DougSillars. Youtube handles all this encoding for streaming. Just upload one high-quality .mp4 file and let them handle the rest. High quality=1080p, high bitrate, high frame rate. Your videographer knows what to do about making good youtube source material. Test carefully on mobile devices. – O. Jones Nov 06 '21 at 11:28