# Video Encoding
Video encoding is the process of compressing raw video data using a codec (coder-decoder) to reduce file size while preserving quality. Modern codecs like H.264, H.265 (HEVC), VP9, and AV1 use techniques like inter-frame prediction (storing only differences between frames), intra-frame compression, and motion estimation. The tradeoff: more compression = smaller files but longer encoding time and potential quality loss.
Key concepts: bitrate (data per second), resolution, frame rate, and encoding profiles (baseline, main, high). Container formats (MP4, MKV, WebM) wrap encoded video with [[Audio Encoding]] and metadata. Streaming services use adaptive bitrate streaming (HLS, DASH) to adjust quality based on bandwidth. Tools like FFmpeg, HandBrake, and [[VLC]] handle encoding tasks.
## Common Codecs
| Codec | Use Case | Notes |
|-------|----------|-------|
| H.264/AVC | Universal compatibility | Most widely supported |
| H.265/HEVC | 4K, streaming | 50% smaller than H.264 |
| VP9 | YouTube, WebM | Open, royalty-free |
| AV1 | Next-gen streaming | Best compression, slow encode |
## References
- https://en.wikipedia.org/wiki/Video_coding_format
## Related
- [[Audio Encoding]]
- [[VLC]]
- [[FFmpeg]]
- [[Video Editing]]