How to Tune Rav1e for Animation and Live-Action
This article explores the encoding and tuning options available in the rav1e AV1 encoder, comparing how to optimize settings for animated content versus live-action video. You will learn how to utilize rav1e’s built-in tuning modes, adjust quantizer values, and configure specific parameters to achieve the best visual quality and file size efficiency for both video types.
Understanding rav1e’s Tuning Options
The rav1e encoder features a primary tuning parameter,
--tune, which dictates how the encoder evaluates video
quality and allocates bitrate. Unlike older encoders like x264 or x255,
rav1e does not have highly specific, pre-configured presets named
“animation” or “touhou.” Instead, it relies on two primary tuning modes
to handle different content characteristics:
- Psychovisual (Default): Optimizes the video based on human visual perception. It prioritizes preserving textures, details, and complex patterns that the human eye naturally focuses on, even if it results in slightly lower objective metric scores.
- PSNR: Optimizes strictly for Peak Signal-to-Noise Ratio (PSNR) mathematical metrics. It aims for absolute pixel-to-pixel accuracy relative to the source, often at the expense of perceived visual sharpness in complex scenes.
Tuning rav1e for Live-Action Content
Live-action video is characterized by high-frequency details, camera noise, organic textures (like skin, foliage, and water), and film grain. To encode live-action efficiently while preserving its natural look, use the following configuration strategy:
1. Enable Psychovisual Tuning
Always use --tune psychovisual (or leave it to default).
Psychovisual algorithms prevent the encoder from smoothing out fine
details like hair, fabric textures, and background environments.
2. Manage Film Grain
Live-action film grain is incredibly costly to encode directly. * Film Grain Synthesis: Instead of encoding the grain, use AV1’s film grain synthesis. This analyzes the grain, removes it during encoding to save bitrate, and instructs the decoder to recreate and apply a synthetic grain overlay during playback.
3. Quantizer (QP) Selection
- Recommended Range: A quantizer value between 80 and 120 (on rav1e’s 0–255 scale) is generally ideal for high-quality live-action encodes. Lower values preserve more texture but increase file size significantly.
Tuning rav1e for Animated Content
Animated content (anime, traditional cartoons, and flat 2D vector art) differs fundamentally from live-action. It features large areas of flat, solid colors, gradient skies, sharp outlines, and minimal organic texture.
To optimize rav1e for animation, apply these adjustments:
1. Psychovisual vs. PSNR Tuning
While --tune psychovisual remains the standard
recommendation for most content, animated flat lines can sometimes
suffer from “ringing” artifacts (blurry halos around sharp edges) when
psychovisual algorithms over-allocate bits to edge boundaries. * If you
notice ringing artifacts around character outlines, experimenting with
--tune psnr can sometimes yield cleaner, sharper edges in
highly stylized 2D animation, though psychovisual is still
preferred for modern anime with complex lighting and digital
effects.
2. Leverage Higher Quantizer (QP) Values
Because animation contains less spatial complexity (fewer high-frequency textures), the encoder can compress flat color blocks much more efficiently. * Recommended Range: You can safely push the quantizer higher, between 110 and 140, without experiencing noticeable quality degradation. This results in massive space savings compared to live-action encodes.
3. Watch for Color Banding
Animated gradients (such as sunsets or skies) are highly susceptible
to color banding. * 10-bit Encoding: Always encode
animation in 10-bit color depth
(--character-depth 10), even if the source is 8-bit. This
gives the encoder a higher precision color space, virtually eliminating
banding in gradients.
Summary Comparison
| Setting / Feature | Live-Action Optimization | Animation Optimization |
|---|---|---|
| Primary Tuning | --tune psychovisual |
--tune psychovisual (or
--tune psnr for sharp 2D lines) |
| Quantizer (QP) Range | 80 – 120 (Lower for detail retention) | 110 – 140 (Higher for compression efficiency) |
| Key Focus | Texture, film grain, and organic detail retention | Edge sharpness, preventing color banding in gradients |
| Color Depth | 10-bit (highly recommended) | 10-bit (mandatory to prevent banding) |