Serve videos as videos. Photo data compresses better with Jpeg. But gifs are still a better option for animated illustrated graphics.
Why is JPEG the de facto lossy compression format for photos? It always bugs me that video formats get something new every 5 or so years yet photos are in JPEGs for decades.
Video formats get something new pretty much by necessity as resolution and quality increases mean older formats strain links.
Serving a 100k heif instead of a 500k jpeg is not going to materially change much.