Skip to main content

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
It’s a basic building block—you’ll create these frequently but they’re simple.

Quick Example

// Full HD 1080p
var fullHD = new CameraResolutionDescriptor(1920, 1080);

// HD 720p
var hd = new CameraResolutionDescriptor(1280, 720);

// 4K UHD
var uhd = new CameraResolutionDescriptor(3840, 2160);

// Use in a track descriptor
var track = new CameraTrackDescriptor(fullHD, bitrate: 8 << 20, framerate: 60);

Common Resolutions

NameWidthHeightAspect RatioUse Case
720p (HD)128072016:9Mobile, streaming, low-end hardware
1080p (Full HD)1920108016:9Standard quality, most common
1440p (2K/QHD)2560144016:9High quality, gaming monitors
4K (UHD)3840216016:9Premium quality, requires powerful hardware
Square108010801:1Social media (Instagram, TikTok)
Vertical108019209:16Mobile-first, stories, reels

Default Value

If you create a CameraResolutionDescriptor with no parameters, you get a 512×512 square:
var defaultRes = new CameraResolutionDescriptor();
// width: 512, height: 512
This is rarely useful—always specify your target resolution explicitly.

Common Patterns

Standard 16:9 resolutions

var resolutions = new[]
{
    new CameraResolutionDescriptor(1280, 720),   // 720p
    new CameraResolutionDescriptor(1920, 1080),  // 1080p
    new CameraResolutionDescriptor(2560, 1440),  // 1440p
    new CameraResolutionDescriptor(3840, 2160)   // 4K
};

Social media-optimized

// Instagram/TikTok square
var square = new CameraResolutionDescriptor(1080, 1080);

// Stories/Reels vertical
var vertical = new CameraResolutionDescriptor(1080, 1920);

// YouTube landscape
var youtube = new CameraResolutionDescriptor(1920, 1080);

Performance tiers

// Low-end devices
var low = new CameraResolutionDescriptor(854, 480);    // 480p

// Mid-range devices
var medium = new CameraResolutionDescriptor(1280, 720); // 720p

// High-end devices
var high = new CameraResolutionDescriptor(1920, 1080);  // 1080p

Aspect Ratio Considerations

Always match your source content aspect ratio. Recording 4:3 gameplay to 16:9 video will add black bars.
Common aspect ratios:
  • 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)
Calculate aspect ratio: width / height
  • 1920 / 1080 = 1.777… ≈ 16:9
  • 1080 / 1080 = 1.0 = 1:1

Performance Impact

Higher resolutions = more pixels = more processing power required:
ResolutionPixelsRelative Cost
720p921,6001× (baseline)
1080p2,073,6002.25×
1440p3,686,400
4K8,294,400
Doubling width and height quadruples the pixel count. 4K has 4× the pixels of 1080p, not 2×.

API Reference

Constructor

public CameraResolutionDescriptor(
    uint width = 512,
    uint height = 512
)

Parameters

  • width — Horizontal resolution in pixels (default: 512)
  • height — Vertical resolution in pixels (default: 512)

Fields

FieldTypeDescription
WidthuintHorizontal resolution in pixels
HeightuintVertical 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
Even numbers preferred — Some encoders require width/height divisible by 2 or 8