What Problem Does This Solve?
Video capture needs to know the output dimensions: 1920×1080, 1280×720, etc. This simple struct defines the width and height in pixels.CameraResolutionDescriptor is used inside CameraTrackDescriptor to specify resolution for recording and streaming tracks.
When to Use This
You’ll use this whenever defining:- Video output resolution in quality presets
- Custom camera configurations
- Resolution-specific settings
Quick Example
Common Resolutions
| Name | Width | Height | Aspect Ratio | Use Case |
|---|---|---|---|---|
| 720p (HD) | 1280 | 720 | 16:9 | Mobile, streaming, low-end hardware |
| 1080p (Full HD) | 1920 | 1080 | 16:9 | Standard quality, most common |
| 1440p (2K/QHD) | 2560 | 1440 | 16:9 | High quality, gaming monitors |
| 4K (UHD) | 3840 | 2160 | 16:9 | Premium quality, requires powerful hardware |
| Square | 1080 | 1080 | 1:1 | Social media (Instagram, TikTok) |
| Vertical | 1080 | 1920 | 9:16 | Mobile-first, stories, reels |
Default Value
If you create aCameraResolutionDescriptor with no parameters, you get a 512×512 square:
Common Patterns
Standard 16:9 resolutions
Social media-optimized
Performance tiers
Aspect Ratio Considerations
Always match your source content aspect ratio. Recording 4:3 gameplay to 16:9 video will add black bars.
- 16:9 — Standard widescreen (1920×1080, 1280×720)
- 21:9 — Ultrawide (2560×1080)
- 4:3 — Legacy (1024×768)
- 1:1 — Square (1080×1080)
- 9:16 — Vertical mobile (1080×1920)
width / height
- 1920 / 1080 = 1.777… ≈ 16:9
- 1080 / 1080 = 1.0 = 1:1
Performance Impact
Higher resolutions = more pixels = more processing power required:| Resolution | Pixels | Relative Cost |
|---|---|---|
| 720p | 921,600 | 1× (baseline) |
| 1080p | 2,073,600 | 2.25× |
| 1440p | 3,686,400 | 4× |
| 4K | 8,294,400 | 9× |
API Reference
Constructor
Parameters
width— Horizontal resolution in pixels (default: 512)height— Vertical resolution in pixels (default: 512)
Fields
| Field | Type | Description |
|---|---|---|
Width | uint | Horizontal resolution in pixels |
Height | uint | Vertical resolution in pixels |
Best Practices
Match display resolution — Don’t record 4K from a 1080p display
Consider target platform — Mobile users rarely need >1080p
Test performance — Higher resolution = higher CPU/GPU load
Related
- CameraTrackDescriptor — Uses resolution with bitrate/framerate
- QualityOption — Quality presets using track descriptors