When you export or stream video from a camera, editor, or live tool, you will often see a setting named Constant Rate Factor or simply CRF. It shows up in encoders like x264, x265, FFmpeg, HandBrake, and OBS. Understanding how CRF controls quality and file size helps you avoid blocky footage, massive downloads, and poor playback on different platforms and devices.
Repair Corrupted Files To Save Your Data
Security Verified. Over 7,302,189 people have downloaded it.
In this article
What Is Constant Rate Factor (CRF)?
Constant Rate Factor (CRF) is a bitrate control strategy used in modern video encoders such as x264 (H.264) and x265 (H.265/HEVC). Instead of forcing a fixed bitrate, CRF tells the encoder to aim for a specific visual quality level and to adjust the bitrate up or down depending on how complex each frame or scene is.
In simple terms, CRF is a quality slider: low values mean higher quality and larger files; high values mean lower quality and smaller files. It belongs to the family of variable bitrate (VBR) quality-based modes and plays a central role during encoding, exporting, and transcoding for platforms like YouTube, Vimeo, and social media.
Creators encounter CRF in desktop encoders (FFmpeg, HandBrake), streaming software (OBS, Streamlabs), and sometimes in NLE export dialogs (via x264/x265, plug-ins, or custom presets) when choosing how to balance video quality against file size and bandwidth.
Why Is Constant Rate Factor (CRF) Important in Video Compression?
The main problem CRF solves is the uneven complexity of real-world footage. A simple talking head against a plain background is much easier to compress than a handheld action shot or a detailed cityscape. Using one constant bitrate for both forces unnecessary bits into easy scenes and starves complex ones, which leads to either wasted storage or visible artifacts.
With CRF based encoding:
- The encoder spends more bits on complex scenes (fast motion, noise, fine textures) to maintain consistent perceived quality.
- It uses fewer bits on simple scenes (slides, static shots, dark frames) where extra detail would not be visible.
That choice impacts several areas:
- Bitrate efficiency and file size: Files are usually smaller than constant-bitrate encodes at similar quality because bits are allocated where they matter most.
- Image quality and motion handling: Complex motion, gradients, and detailed patterns look cleaner, with fewer blocks, banding, or smearing, compared to a too-low fixed bitrate.
- Encoding speed: CRF is a single-pass mode, so it is typically faster than two-pass VBR while delivering good quality for most workflows.
- Editing and playback: Outputs are more predictable in visual consistency, which helps when mixing multiple sources or delivering to multiple devices.
- Streaming performance: For live streaming, CRF alone is not ideal because connection bandwidth is fixed; it is often combined with a bitrate cap. For pre-recorded uploads, CRF works very well.
However, CRF has limitations:
- You do not control exact output file size or average bitrate, which can matter for strict delivery specs, broadcast targets, or limited storage.
- Extreme CRF values can either waste space (too low) or destroy fine detail (too high).
- Different codecs interpret the same CRF number differently: a CRF 20 in x264 is not equal to CRF 20 in x265 in terms of quality or bitrate.
How Does Constant Rate Factor (CRF) Work in the Encoding Workflow?
Inside the encoding pipeline, CRF acts during rate control, which decides how many bits to spend on each frame. After the encoder analyzes the input (motion estimation, macroblock or CTU analysis, prediction, and transform), the rate control module checks the target CRF value and adjusts quantization strength. The goal is to keep perceived quality roughly constant over time while respecting the chosen quality level.
When you start an export with CRF mode enabled, the workflow looks like this:
- Frames are read from your source (camera file, editing timeline, or screen capture).
- The encoder measures how difficult each frame or region is to compress.
- Based on the global CRF value and encoder preset (fast, medium, slow), it chooses quantizers to balance quality vs. bits spent.
- Simple regions receive higher quantization (fewer bits); complex areas receive lower quantization (more bits).
- The final stream ends up with a variable bitrate pattern that tracks scene complexity while staying near the chosen quality level.
CRF in common video tools
You will run into CRF in many recording and encoding tools used across photography, cinematography, and content creation workflows:
- FFmpeg: The typical syntax is
-c:v libx264 -crf 18 -preset slowor-c:v libx265 -crf 22. Here the-crfflag sets quality, and-presetcontrols speed vs. efficiency. - x264/x265 CLI: Directly expose CRF as their primary quality mode.
- HandBrake: Offers a "Constant Quality" slider, which maps to CRF for x264/x265. You choose a number (e.g., 18–23 for x264) instead of a fixed bitrate.
- OBS Studio: For recording, you can choose the x264 encoder and set "Rate Control" to CRF. For streaming, many users combine CBR or capped CRF (e.g., CRF with a max bitrate) to keep streams bandwidth-safe.
- Adobe Premiere Pro / Media Encoder (via x264 plug-ins or intermediate tools): Advanced users export via lossless or mezzanine codecs and then run a separate x264/x265 CRF encode for final delivery.
- Hardware encoders and cameras: Some devices and codecs provide a quality-based mode that behaves similarly to CRF, though it may use different names such as "CQ" (constant quality) or "Q-based" control.
How CRF interacts with other encoding settings
CRF does not work in isolation. It interacts with multiple other encoder parameters that determine real-world quality and compatibility:
- Preset: In x264/x265, the preset (ultrafast to placebo) decides how thoroughly the encoder searches for efficient compression. At the same CRF value, a slower preset usually provides better quality and/or smaller files but takes more CPU time.
- Resolution and frame rate: Higher resolutions or frame rates require more bits to maintain the same visual quality at a given CRF. For 4K 60p, CRF 23 may be too compressed, while for 1080p 24p, it might look acceptable.
- Profile, level, and compatibility: For device or platform compatibility (TVs, smartphones, social media, or online galleries that display photo slideshows with embedded video), you may need to choose specific codec profiles and levels. The CRF value then works within those limits.
- Audio bitrate: CRF only controls video quality. Total file size for export or streaming also depends on the audio track(s), subtitles, and container overhead.
- Bitrate caps: For streaming or strict delivery, you can combine CRF with a maximum bitrate or VBV (Video Buffering Verifier) to prevent bitrate spikes that may break playback on slow connections or low-power devices.
For photographers turning time-lapse sequences or slideshow presentations into video, understanding CRF helps ensure that fine details, gradients, and subtle color transitions in your images survive the video encoding step when you export for web, 4K TV, or mobile viewing.
When Should You Care About Constant Rate Factor (CRF)? Common Mistakes and Quick Tips
CRF matters most for people who regularly export, encode, or transcode video:
- Video editors finishing projects in Premiere, Resolve, or Final Cut and creating H.264/H.265 deliverables.
- Streamers and creators recording gameplay, tutorials, or live shows in OBS or similar software.
- Photographers and filmmakers turning RAW or JPEG sequences into time-lapse clips or behind-the-scenes videos.
- Archivists and studios compressing masters for efficient long-term storage while protecting image quality.
It matters less if you:
- Record only in-camera and upload directly without recompression.
- Use platforms or presets that lock everything for you and hide advanced settings.
- Are following a strict broadcast spec that requires defined bitrates, where two-pass VBR or CBR may be mandatory.
Common misunderstandings about CRF include:
- "CRF 18 always looks the same." Quality depends on content, resolution, frame rate, encoder preset, and codec (x264 vs x265 vs AV1, etc.).
- "Lower CRF is always better." Going far below a sane range (e.g., CRF 10 for x264) often wastes space with minimal visible gain.
- "CRF replaces bitrate limits for streaming." For live streaming, you still need to match your uplink bandwidth and platform guidelines, often via CBR or CRF with a bitrate cap.
- "CRF numbers are interchangeable between codecs." A good range for crf h264 (x264) is usually lower than for crf h265 (x265), which is more efficient.
Quick tips for choosing a best crf value for typical work:
| Codec / Resolution | Suggested CRF range (quality vs size) |
|---|---|
| x264 – 1080p (web, YouTube) | CRF 18–23 (18–20 for high quality, 21–23 for smaller files) |
| x265 – 1080p or 4K | CRF 20–26 (use lower values for detailed or noisy content) |
| Archiving or visually critical work | Use the lower end of each range and a slower preset for smoother gradients and fewer artifacts |
Takeaway: treat CRF as a quality dial. Test a short clip with two or three different values, review on your intended screens (monitor, TV, phone), and pick the lowest bitrate that still looks clean in motion.
How to Use Repairit to Fix a Corrupted Video File
If a crf video encoding job fails mid-export, the power cuts out, or a drive error damages your file, you may end up with a corrupted clip that will not open or play smoothly. In such cases, general media players cannot fix the structural damage, but a dedicated tool like Wondershare Repairit can. You can learn more and download it from the Repairit official website, where it is designed to repair videos from cameras, phones, screen recorders, and editing workflows affected by broken headers, index issues, and other encoding-related problems.
Key features of Wondershare Repairit
- Repairs videos from various cameras, phones, and editing workflows, including clips damaged during crf based exports or file transfers.
- Supports multiple formats and batch repair so you can fix many corrupted files from the same project in one run.
- Offers advanced repair using a sample file to reconstruct severely damaged videos with more accurate structure and playback.
Step-by-step guide to repair corrupted CRF-encoded videos
- Add corrupted video files
Install and open Wondershare Repairit, then go to the Video Repair module. Click the add or "+" button and browse to the folder containing your damaged exports, camera originals, or screen captures. Select one or more corrupted videos that fail to play correctly and import them into the repair list.

- Repair video files
Once your clips are listed, confirm the details (format, resolution, duration) and start the repair process. Repairit will automatically scan each file, analyze the container, headers, and video stream, and then reconstruct damaged or missing structures. During this stage it works to fix issues such as unplayable timelines, frozen frames, or audio-video glitches.

- Save the repaired video files
After the repair completes, preview your videos inside Repairit to confirm they play smoothly from start to finish. If everything looks correct, choose a safe output folder that is different from the damaged file location, then save the repaired versions. You can now bring these fixed clips back into your editor, archive, or share them online without needing to re-shoot or re-encode from scratch.

Conclusion
Constant Rate Factor is one of the most useful controls you can learn when it comes to modern video compression settings. Rather than locking you into a rigid bitrate, CRF lets encoders like x264 and x265 adapt to content complexity and deliver more consistent perceived quality for a given file size. By choosing sensible ranges for crf h264 and crf h265, testing short samples, and pairing them with appropriate presets, you can create exports that look clean on a wide range of devices without overloading storage or bandwidth.
Remember that crf quality is about balance: avoid extreme values, adjust for resolution and content type, and combine CRF with bitrate caps when strict delivery or streaming constraints apply. If something goes wrong and your final render becomes corrupted or unplayable, Wondershare Repairit gives you a practical way to recover valuable footage without redoing the entire shoot or edit.
Next: Two-Pass Encoding
FAQ
-
1. What is a good CRF value for general use?
For x264, many creators use a CRF between 18 and 23 for online delivery, with 18–20 aimed at high quality and 21–23 aimed at smaller files. For x265, you can usually choose slightly higher values (around 20–26) for similar visual quality due to better compression efficiency. -
2. Does a lower CRF always mean better video quality?
A lower CRF does target higher quality by allowing more bits per frame, but beyond a point the improvement is hard to see while file sizes grow quickly. It is better to find a balanced value by testing short segments rather than assuming the lowest CRF is always best. -
3. Is CRF the same as bitrate?
No. Bitrate sets a fixed or averaged number of bits per second, which directly controls file size but can give inconsistent quality. CRF sets a quality target instead and lets the encoder vary bitrate based on scene complexity to keep the viewing experience more consistent. -
4. Can I use CRF for uploading to platforms like YouTube?
Yes. Many people export with crf video encoding and then upload those files for YouTube to re-encode. Choose a reasonable CRF (for example, 18–21 for 1080p x264), ensure your resolution and frame rate match your project, and use a preset that your hardware can handle in a reasonable time. -
5. What should I do if a CRF-encoded video becomes corrupted?
If a CRF-based export is interrupted or the storage device has issues, the resulting file may refuse to play. Try opening it in Wondershare Repairit, which can scan the corrupted container and streams, repair broken headers or indexes, and restore playback without needing to re-encode from the original timeline.