Achieving Good HEVC/CRF Rate Balance for Various Media Sizes and Formats

Abstract: Optimize HEVC encoding quality and file size by selecting appropriate CRF values based on source complexity and resolution.

Created: 2026-08-11 by
To achieve a good HEVC/CRF rate balance for various media sizes and formats, you must adjust the Constant Rate Factor based on source complexity rather than using a single value. Higher CRF numbers produce smaller files with lower quality, while lower numbers yield larger files with higher fidelity. By understanding how DVD, Blu-Ray, and digital downloads differ in bitrate and resolution, you can select the optimal CRF to maintain visual integrity without wasting storage space.

Understanding the CRF Scale

The Constant Rate Factor (CRF) is the most important encoding option in x265 because it allows for the best quality-to-filesize ratio. It operates on a logarithmic scale where the maximum value is 51, representing the worst quality, and the minimum is 0, which is lossless. For most practical purposes, a CRF of 23 is considered visually lossless or nearly so for standard definition content. As you decrease the number, the file size increases exponentially while quality improvements become marginal. Conversely, increasing the number reduces file size rapidly but introduces visible artifacts like blocking or banding. For high-quality archival, many users aim for a CRF between 18 and 20. This range ensures that even when viewed on large screens or during fast-paced action scenes, the image remains clean. If your goal is efficient streaming or limited storage, a CRF between 24 and 28 is often acceptable for casual viewing. However, going below 18 rarely provides noticeable benefits for human eyesight and wastes significant disk space. Going above 28 usually results in noticeable degradation, especially in darker scenes or complex textures.

Adjusting for Source Material: DVD vs. Blu-Ray

Different sources require different baseline settings due to their inherent quality and resolution. DVD content is typically 480p or 576i with heavy compression artifacts already present from the original MPEG-2 encoding. Re-encoding DVDs with a very low CRF is pointless because the source quality is the bottleneck. A CRF of 22 to 24 is usually sufficient for upscaling or repackaging DVDs. Using a lower CRF here only inflates the file size without adding detail that was not captured in the original broadcast. Blu-Ray sources are significantly different. They offer 1080p or 4K resolution with much higher bitrates and cleaner video data. To preserve the sharpness and dynamic range of a Blu-Ray rip, you should use a lower CRF, typically between 18 and 20. This ensures that fine details in shadows and highlights are retained. If you are converting a 4K Blu-Ray down to 1080p, you might be able to increase the CRF slightly to 20 or 21, as the downsampling process itself adds some smoothing that masks minor compression artifacts.

Handling Digital Downloads and Web Content

Video downloads vary wildly depending on the platform and codec used. Many web videos are encoded with variable bitrates and aggressive compression to save bandwidth. When re-encoding these files, it is crucial to analyze the source first. If the download is already heavily compressed, using a low CRF will result in massive file sizes with no visible improvement. In such cases, a CRF of 24 to 26 is often the sweet spot. For high-bitrate web releases, such as those found on premium streaming services, treat them similarly to Blu-Rays. Use a CRF of 18 to 20 to maintain clarity. However, be aware that some modern codecs like AV1 or VP9 may handle certain types of motion differently than HEVC. While this article focuses on HEVC, if you encounter issues with specific playback devices, you might need to refer to resources on troubleshooting unsupported codecs. You can learn more about handling tricky codec scenarios by reading Troubleshooting Dolby Vision Video File issues, as similar principles apply to format compatibility and quality preservation.

Optimizing for Specific Media Sizes

File size constraints often dictate the final CRF choice. If you are preparing videos for mobile devices with limited storage, you may need to push the CRF higher. However, simply raising the CRF is not enough; you should also consider reducing the resolution. Encoding a 4K video at CRF 20 for a phone screen is wasteful. Instead, encode at 1080p with a CRF of 22 to 24. This approach yields a much smaller file while maintaining excellent perceived quality on small displays. For archiving purposes where space is less of a concern, prioritize quality over size. Use a CRF of 18 or lower. You can also add two-pass encoding if you have strict size limits, although this is less common with CRF. Two-pass encoding analyzes the video first and then encodes it with a target bitrate, offering more predictable file sizes. However, for general use, CRF alone is superior because it adapts to scene complexity automatically. Complex scenes get more bits, while simple scenes get fewer, ensuring consistent quality throughout the video.

Practical Encoding Settings

When using tools like FFmpeg or HandBrake, ensure you are using the correct preset. The preset controls the speed of encoding and has a minor impact on efficiency. Slower presets like medium or slow provide better compression efficiency, meaning you can achieve the same quality with a slightly higher CRF (smaller file). For example, using the slow preset might allow you to use CRF 22 instead of 21 for the same visual quality. Always verify your output. Play back the encoded video and look for artifacts in dark areas, which are prone to banding in HEVC. If you notice banding, try lowering the CRF by one or two points. If the video looks smooth and detailed, you have achieved a good balance. Remember that subjective quality varies by viewer, so find a setting that satisfies your personal standards. For further optimization techniques, you might explore methods for upscaling older content, as discussed in High-Quality 4K SWF to 4K Video Upscaling Without FFmpeg, which shares similar goals of enhancing visual fidelity.

Frequently Asked Questions

What is the difference between CRF and bitrate?

CRF is a quality-based metric that adjusts the bitrate dynamically per frame, while bitrate is a fixed average amount of data allowed per second. CRF generally produces better quality at smaller file sizes because it allocates more data to complex scenes and less to simple ones. Bitrate is useful when you have strict storage constraints, but CRF is preferred for balancing quality and size.

Should I use two-pass encoding with CRF?

No, two-pass encoding is designed for constant bitrate (CBR) or average bitrate (ABR) modes, not for CRF. When using CRF, the encoder automatically determines the optimal bitrate for each segment of the video. Using two-pass with CRF is redundant and will not improve quality or reduce file size further.

How do I fix banding in dark scenes?

Banding in dark scenes is often caused by insufficient bitrate allocation or poor dithering. Lowering the CRF by 1-2 points can help distribute more data to these areas. Additionally, enabling dithering filters in your encoding software can break up the visible bands by adding subtle noise, making the transition smoother to the human eye.

Is HEVC better than H.264 for file size?

Yes, HEVC (H.265) typically offers 50% better compression efficiency than H.264 (AVC) at the same quality level. This means you can halve the file size while maintaining identical visual fidelity. However, HEVC requires more processing power to encode and decode, which may affect performance on older hardware.

Can I use the same CRF for all resolutions?

While you can use the same CRF across resolutions, it is not always optimal. Higher resolutions contain more detail, so they may benefit from a slightly lower CRF to preserve sharpness. Conversely, lower resolutions may tolerate a higher CRF since fine details are lost anyway. Experimenting with slight adjustments based on resolution can yield better results.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More