WebM

From Valve Developer Community
(Redirected from WEBM)
Jump to: navigation, search
English (en)Translate (Translate)

Stub

This article or section is a stub. You can help by adding to it.

WebM (file extension .webm) is a video file format developed by Wikipedia icon Google, based upon the Wikipedia icon Matroska (MKV) container format. WebM was originally designed to be used on webpages to save bandwidth, but it also has some benefits when it comes to video games and many other applications.

The biggest benefit of WebM over Bink (or AVI) for games is that of file size; a WebM video will be significantly smaller than that of a similar-quality Bink file as WebM has better compression than Bink. For example, the installation size of Hunt Down the Freeman Hunt Down the Freeman decreased by 5.7 GB when switching its FMV cutscenes from Bink to WebM[1]. Furthermore, WebM is much more common and easier to make than the Bink file format, as Bink requires the RAD Video Tools software that only takes AVI files (MP4 initially required QuickTime until the requirement was eventually removed as QuickTime for Windows is no longer supported by Apple).

WebM is supported in the following games, engines, and engine branches:

Video codecs Audio codecs
Implementation VP8 VP9 AV1 Vorbis Opus
Source 2 Source 2 (Counter-Strike 2 tested) Yes Yes No Yes** Yes**
GoldSrc GoldSrc
(since 25th anniversary update; intro video only)
Yes Yes No Yes* No
Counter-Strike: Global Offensive Counter-Strike: Global Offensive
(since 2018 Panorama update)
Yes Yes No Yes*** No
Team Fortress 2 Team Fortress 2 (since April 18, 2024/64-bit update) Yes Yes No Yes No
Strata Source Strata Source Yes Yes No Yes No
WebM Video Services for Source 2013
(used by Hunt Down the Freeman Hunt Down the Freeman)
Yes Yes No Yes Yes
*Audio is read, but muted. 🖿<moddir>/sound/ui/valve_sound.wav is used instead.
**Audio is read, but muted. (only in Counter-Strike 2) If the video was unable to play due to incompatible codecs or other codecs issue, then part of the intro sounds (🖿sounds/ui/logo_startup.vsnd_c, which is played separately) will not play or likely be played in lower volume.
***Sometimes audio plays in slower speed and lower pitch.


To convert a 1080p MP4 file to a WebM that will reliably play in the the above games and have reasonable quality and encoding speed, use the following Wikipedia icon ffmpeg script:

ffmpeg -i input.mp4 -acodec libvorbis -ab 128k -vb 0 -crf 31 output.webm
  • To increase audio quality, increase -ab.
  • To increase video quality, reduce -crf. Lower values may be necessary for higher and lower resolutions to reduce macroblocking artefacts.

References

References
1. Hunt Down The Freeman - July blog: where we're at + looking for team members! - Steam News
Bink video is replaced with webm (like CSGO and Source 2) and has successfully freed up 5.7GB of space

External links