HTML webm vs mp4 (and/or webp vs jpeg)

Legba

At the Crossroads
Game Developer
Jan 27, 2020
30
148
Working on an HTML/Twine game and the question's in the title, really: I initially assumed mp4 would be a better choice for videos as it had wider compatibility, but with Safari capable of running webm now is there still a good reason to choose mp4 over webm? I know webm can reduce the size a bit, and I believe I read that mp4 is less taxing on a CPU so it may be better for tablet/smartphones, though I'm not working specifically for those.

Similarly, I know if you want transparency then webp is the way to go but other than that, is there a reason to pick webp over jpeg or vice versa?

Thanks in advance for any advice.
 

DuniX

Well-Known Member
Dec 20, 2016
1,152
756
is there a reason to pick webp over jpeg or vice versa?
From my tests webp that is lossy tends to mess with colors, only use lossless if you want it as a png substitute.
Jpeg on the other hand is known for their jpeg artifacts.
It depends on a case by case basis for what kind of results are acceptable depending on the color range that is affected which you can only do by testing.
Webp on a good qulity rate is great at maintaining details.
Webm is basically the same as webp I believe so similar tradeoffs. Not sure about mp4 as that can depend on codecs and stuff.
 
  • Like
Reactions: Legba

Legba

At the Crossroads
Game Developer
Jan 27, 2020
30
148
Thanks. I've been using the standard of H.264 with mp4, and no audio codec (so far, but probably would use the usual there too, AAC mpeg 2/4 is what my editing program defaults to).