HTML5 background video encoding settings
There shouldn't be anything special about making a video for HTML5 video, so just look for any video encoding guide to learn about choosing how to trade off CPU time vs. bitrate vs. quality.

Hint: encode once, display many is a use case where it makes sense to spend as much CPU time as possible on the encode, to get the quality you want in as small a download as possible.