Notes on video formats and encoding
A compact reference for preparing video files for web playback and storage.
Containers and codecs
MP4
Widely supported container, usually paired with H.264 video and AAC audio.
WebM
Open container for the web, used with VP8, VP9 or AV1 and Vorbis or Opus.
MKV
Flexible container that holds multiple audio and subtitle tracks.
Typical H.264 bitrates, 30 fps
| Resolution | Frame size | Video bitrate |
|---|---|---|
| 480p | 854 × 480 | 1–2 Mbps |
| 720p | 1280 × 720 | 2.5–4 Mbps |
| 1080p | 1920 × 1080 | 4.5–8 Mbps |
Actual needs depend on motion, noise and encoder settings.
Useful FFmpeg commands
Convert to web-friendly MP4:
ffmpeg -i input.mov -c:v libx264 -crf 22 -pix_fmt yuv420p -c:a aac -movflags +faststart output.mp4
Resize to 720p height:
ffmpeg -i input.mp4 -vf scale=-2:720 -c:a copy output_720p.mp4