Skip to main content

Quality Settings

Frame offers two primary quality control modes: CRF (Constant Rate Factor) for quality-based encoding and Target Bitrate for size-based encoding. This guide explains how each mode works and when to use them.

Quality Control Modes

CRF (Constant Rate Factor)

Mode: videoBitrateMode: "crf"CRF is a quality-based encoding mode that maintains consistent visual quality throughout the video, allowing the bitrate to vary as needed.

How CRF Works

CRF uses a scale where lower numbers = higher quality:For Software Encoders (H.264/H.265):
  • 0 - Lossless (massive file sizes)
  • 17-18 - Visually lossless (archival quality)
  • 19-23 - High quality (recommended)
  • 23-28 - Medium quality (default)
  • 29-34 - Low quality (web/streaming)
  • 35+ - Very low quality (avoid)

CRF Scale Reference

CRF ValueQuality LevelUse CaseApprox. File Size*
18Visually LosslessArchival, mastering100% (baseline)
20ExcellentHigh-quality delivery70%
23GoodDefault - General use50%
26AcceptableStreaming, web35%
28FairLow-bandwidth streaming25%
30PoorWeb previews only18%
*Relative to CRF 18. Actual sizes vary by content.

Frame’s CRF Configuration

{
  "videoBitrateMode": "crf",
  "crf": 23
}
The crf field accepts values 0-51:
  • Default: 23 (balanced quality)
  • Archival: 18-20
  • Web: 28-30

Benefits of CRF

  • Consistent quality across all scenes
  • Efficient encoding - allocates bits where needed
  • Predictable quality - same CRF = same visual quality
  • Variable bitrate - simple scenes use fewer bits

Drawbacks of CRF

  • Unpredictable file size - varies by content complexity
  • Can’t target specific file size
CRF is the recommended mode for most use cases. It provides the best quality-to-size ratio and is used by all of Frame’s built-in presets.

Content-Specific CRF Guidance

Animation/Simple Graphics:
  • Very efficient compression
  • Use CRF 20-24 for excellent quality
  • Files will be relatively small
Live Action/Complex Scenes:
  • Requires higher bitrate
  • Use CRF 18-22 for excellent quality
  • Files will be larger
Screen Recordings/Text:
  • Text can look blurry at high CRF
  • Use CRF 18-20 for sharp text
  • Consider lossless (CRF 0) for critical detail

Hardware Encoder Quality

Hardware encoders (NVENC, VideoToolbox) use different quality systems than software encoders.

NVIDIA NVENC Quality

For h264_nvenc, hevc_nvenc, av1_nvenc: Frame uses the quality field (0-100) which maps to NVENC’s CQ (Constant Quality) parameter:
CQ = 52 - (quality / 2)
Quality Scale:
  • Quality 100 → CQ 1 (best quality, largest files)
  • Quality 80 → CQ 12 (excellent quality)
  • Quality 60 → CQ 22 (high quality)
  • Quality 50 → CQ 26 (balanced) - Default
  • Quality 40 → CQ 32 (acceptable quality)
  • Quality 20 → CQ 42 (low quality)
  • Quality 0 → CQ 51 (poor quality)
Quality ValueCQUse Case
65-7017-19High quality archival
50-6022-26General use, balanced
40-4530-34Web streaming
30-3535-39Low bandwidth

NVENC Configuration Example

{
  "videoCodec": "h264_nvenc",
  "videoBitrateMode": "crf",
  "quality": 50,
  "nvencSpatialAq": true,
  "nvencTemporalAq": true
}
NVENC quality ~50-55 is comparable to software CRF 23-25, providing good quality with 5-10x faster encoding.

Apple VideoToolbox Quality

For h264_videotoolbox, hevc_videotoolbox: VideoToolbox uses the quality field directly (0-100), where higher is better: Quality Scale:
  • Quality 100 - Maximum quality
  • Quality 70-80 - High quality
  • Quality 60 - Good quality
  • Quality 50 - Balanced - Default
  • Quality 40 - Acceptable
  • Quality 20-30 - Low quality
  • Quality 0 - Minimum quality
Quality ValueUse Case
70-80Archival, high quality
50-60General use, balanced
40-45Web streaming
30-35Low bandwidth

VideoToolbox Configuration Example

{
  "videoCodec": "h264_videotoolbox",
  "quality": 50,
  "hwDecode": true
}
VideoToolbox quality is opposite of CRF: higher numbers = better quality (not lower like software CRF).

Quality vs File Size Tradeoffs

Visual Quality Perception

Understanding diminishing returns in quality:
File Size Difference: ~2x (CRF 18 is twice as large)Visual Difference: Minimal for most contentWhen the difference matters:
  • Color grading and post-production
  • Large displays (4K+ monitors)
  • Professional archival
When it doesn’t matter:
  • Web/mobile viewing
  • Standard displays
  • Casual playback
Recommendation: Use CRF 23 for general use, CRF 18-20 only for archival or professional work.
File Size Difference: ~2x (CRF 28 is half the size)Visual Difference: Noticeable in complex scenesWhen CRF 28 is acceptable:
  • Small screen viewing (phones)
  • Low-motion content
  • Bandwidth-constrained delivery
When to avoid CRF 28:
  • High-motion content (sports, action)
  • Large screen playback
  • Complex/detailed scenes
Recommendation: CRF 23 is the sweet spot for most use cases.
File Size Difference: 10-20% larger with hardware at equivalent qualityEncoding Speed: 5-10x faster with hardwareVisual Quality: Very similar at recommended settingsRecommended settings for comparable quality:
  • Software: CRF 23
  • NVENC: Quality 50-55
  • VideoToolbox: Quality 50-55
Choose hardware when: Speed matters more than 10-20% file size savingsChoose software when: Smallest possible file size is critical

Content Complexity Impact

How different content types affect file size at the same quality setting: Animation/Simple Graphics (CRF 23):
  • Very few details, solid colors
  • File size: Small (1x baseline)
  • Compression efficiency: Excellent
Live Action/Medium Complexity (CRF 23):
  • Typical movies, TV shows
  • File size: Medium (2-3x animation)
  • Compression efficiency: Good
High Detail/Grain/Noise (CRF 23):
  • Film grain, nature footage, complex textures
  • File size: Large (4-5x animation)
  • Compression efficiency: Lower
  • May need CRF 18-20 for acceptable quality
Content complexity has a larger impact on file size than CRF adjustments. A 1080p animation at CRF 23 might be 500 MB, while nature footage at CRF 23 could be 2-3 GB.

Balanced Quality/Size

For everyday video conversion and storage:Software Encoding (H.264):
{
  "videoCodec": "libx264",
  "videoBitrateMode": "crf",
  "crf": 23,
  "preset": "medium"
}
Hardware Encoding (NVENC):
{
  "videoCodec": "h264_nvenc",
  "videoBitrateMode": "crf",
  "quality": 50,
  "preset": "medium",
  "nvencSpatialAq": true
}
Expected Results:
  • Good quality for most viewing scenarios
  • Reasonable file sizes
  • Fast encoding (especially with hardware)

Quality Assessment Tips

How to Validate Quality Settings

  1. Encode a short clip (30-60 seconds)
  2. Compare multiple quality settings side-by-side
  3. View on target device (phone, TV, monitor)
  4. Look for compression artifacts:
    • Blockiness in gradients
    • Blurriness in fine details
    • Banding in solid colors
    • Motion artifacts in fast movement
Quality Test Checklist:
  • Check complex/detailed scenes
  • Check fast motion sequences
  • Check gradients (sky, shadows)
  • Check text readability
  • Compare file sizes
  • Test on target platform/device

Avoid These Pitfalls

Using CRF Too High:
  • CRF 30+ for high-resolution content
  • Results in visible compression artifacts
  • Fix: Lower CRF to 23-26
Using CRF Too Low Unnecessarily:
  • CRF 15-18 for web/mobile delivery
  • Wastes storage with no visual benefit
  • Fix: Use CRF 23 for general use
Bitrate Mode for Archival:
  • Wastes bits on simple scenes
  • May starve complex scenes of quality
  • Fix: Use CRF mode for archival
Wrong Quality Parameter for Hardware:
  • Using crf field with hardware encoders
  • Fix: Use quality field for NVENC/VideoToolbox
Not Testing on Target Device:
  • Looks fine on 4K monitor, bad on phone
  • Fix: Always test where it will be viewed

See Also

Build docs developers (and LLMs) love