Use Intel's AV1 encoder for more speed:
https://www.phoronix.com/scan.php?page=news_item&px=SVT-AV1-...
https://www.phoronix.com/scan.php?page=news_item&px=SVT-AV1-...
YouTube already has many of its videos encoded in AV1 up to 720p. Try it yourself with Firefox 67 beta, or any other browser which uses the dav1d decoder.
Turn on AV1 on YouTube (set it to "Always prefer AV1"): https://www.youtube.com/testtube
Try the AV1 playlist: https://www.youtube.com/playlist?list=PLyqf6gJt7KuHBmeVzZteZ...
Pick any popular video on YouTube (like a music video) and play it. Check the format with right-click -> Stats for Nerds. If it's AV1 the codec will be "av01".
On my 5-year old laptop, AV1 in Firefox 67 beta is fast enough for 1080p30 and almost fast enough for 1080p60.