Sub topic 8
Choose an encoder and rate control for recording
This chapter assumes you have set your canvas, output resolution, and frame rate (see the video settings chapter). It also assumes you know what bitrate means. The goal is to pick an encoder and a rate control mode that give you sharp text, a reasonable file size, and no dropped frames on your own machine.
What the encoder and rate control decide
The encoder compresses raw frames into H.264, HEVC, or AV1 video as OBS records. Two choices matter most:
- Encoder: the code that does the compression, either on the CPU (software) or on dedicated hardware on the GPU.
- Rate control: the rule that decides how many bits each frame gets.
Screencasts are an easy workload. Most of the screen stays still, so the encoder can spend few bits on most frames. Large bursts of change, such as scrolling or switching windows, are where bad settings show up as blur or blocky text.
Use Advanced output mode
Open Settings > Output and set Output Mode to Advanced. Simple mode hides the rate control and encoder details behind quality presets. Advanced mode has a Recording tab that is separate from the Streaming tab, so recording settings don't have to follow your stream settings. Lessons are recorded, not streamed, so use that tab.
On the Recording tab, set Type to Standard. Set Recording Format as described in the format chapter. Then pick an Encoder.
Software or hardware encoder
The encoder list depends on your hardware and OBS version. Typical entries are:
- Software (x264): runs on the CPU. It gives the best quality for a given file size.
- Hardware (NVENC): NVIDIA GPUs.
- Hardware (QSV): Intel integrated graphics.
- Hardware (AMD): AMD GPUs.
- Apple VT hardware encoder: macOS.
| Factor | Software (x264) | Hardware encoders |
|---|---|---|
| CPU load | High, and it competes with the app you are demonstrating | Low |
| Quality per megabyte | Best | Close on recent GPUs, slightly larger files |
| Rate control options | CBR, ABR, VBR, CRF | CBR, VBR, CQP (varies by encoder) |
| Risk | Dropped frames if the CPU is saturated | Few, but the GPU also renders your capture |
A lesson often involves a heavy application: an IDE, a browser with many tabs, or a build running in a terminal. Hardware encoding keeps the CPU free for that application. If your CPU is fast and the demo is light, x264 is a fine choice. If you aren't sure, record a five-minute test of your heaviest workflow with each encoder and compare the dropped-frame counts and file sizes.
Rate control modes
Rate control sets the trade-off between quality and file size.
| Mode | Available on | What it holds steady | Fit for lessons |
|---|---|---|---|
| CBR | All encoders | A fixed bitrate | Built for streaming. It wastes bits on still frames and starves busy ones. |
| VBR | Most hardware encoders | An average bitrate, with peaks allowed | Acceptable, but you must choose a bitrate. |
| CRF | x264 only | A target quality | Best default for x264. |
| CQP | Most hardware encoders | A fixed quantizer, which is a quality level | The hardware counterpart of CRF. |
CRF and CQP take a number, and a lower number means higher quality and a bigger file. The scales differ from each other, but a starting range of 18 to 23 is reasonable for both. Lower values cost more space for a gain that is hard to see. For screen text, begin at 20 and adjust after a test.
Prefer a quality-based mode for recording. A quality target gives still screens a tiny bitrate and gives fast-changing moments the bits they need. CBR can't do that. Use CBR only when you must hit a specific bitrate, such as a streaming platform limit.
Recommended starting settings
For x264:
- Encoder: Software (x264).
- Rate Control: CRF.
- CRF: 20.
- Keyframe Interval: 0 for automatic, or 2 seconds if you want easier seeking in an editor.
- CPU Usage Preset:
veryfast. Slower presets compress better but use more CPU. Tryfasterorfastonly if you have spare CPU. - Profile:
high. - Tune: none. Leave the field empty, or choose
zerolatencyonly if you are also streaming.
For NVENC, the fields are named differently:
- Encoder: NVIDIA NVENC H.264.
- Rate Control: CQP.
- CQ Level: 20.
- Preset: P5 on recent OBS versions. Higher numbers are slower and better.
- Look-ahead and Psycho Visual Tuning: leave on for quality. Turn them off if you see GPU-related dropped frames.
Menu names vary by OBS version and driver. If a field is missing, use the nearest equivalent and rely on the test recording.
Check the result
Record a test that includes scrolling, window switching, and small code text. Then inspect the file with ffprobe, which ships with FFmpeg:
ffprobe -v error -select_streams v:0 \
-show_entries stream=codec_name,profile,width,height,avg_frame_rate,bit_rate \
-of default=noprint_wrappers=1 lesson-01.mp4bit_rate shows the average video bitrate. It can print as N/A for containers that do not store it, such as MKV. In that case, divide the file size by the duration. This Python script estimates how large a lesson will be:
def estimate_size_mb(bitrate_kbps: float, minutes: float) -> float:
"""Approximate video file size in megabytes for a given average bitrate."""
bits = bitrate_kbps * 1000 * minutes * 60
return bits / 8 / 1_000_000
if __name__ == "__main__":
for kbps in (1500, 3000, 6000):
print(f"{kbps} kbps for 20 min: {estimate_size_mb(kbps, 20):.0f} MB")This prints roughly 225 MB, 450 MB, and 900 MB for the three cases. Audio adds a small amount on top.
Also watch the status bar at the bottom of OBS during the test. Look at the CPU percentage and at Dropped Frames or Skipped frames due to encoding lag.
Common errors
- Using CBR for recording. The file is larger than necessary and busy moments look soft. Switch to CRF or CQP.
- Choosing a slow x264 preset on a busy CPU. OBS shows "Encoding overloaded" and the recording drops frames. Move to a faster preset or use a hardware encoder.
- Setting an extreme quality value. CRF 0 is lossless, and values near 0 produce huge files with no visible gain. Stay at 16 or higher unless you have a specific reason.
- Recording at a resolution the encoder does not suit. Scaling in OBS blurs text. Make the output resolution match the canvas where you can, as set in the video settings chapter.
- Mismatched frame rate. Recording at 60 fps for a static slide lesson doubles the work for no benefit. Use 30 fps unless you demonstrate fast motion.
- Blaming the encoder for a GPU-bound problem. Games and heavy 3D applications can starve NVENC of GPU time. Check GPU usage before changing encoder settings.
Keep the settings
Once a test looks right, store the settings in an OBS profile. Profiles keep output settings separate from scenes, so you can switch between, for example, a high-quality profile and a low-CPU profile without rebuilding anything. The profiles chapter covers this.
Exercise
You record a 30-minute lesson with CBR at 6000 kbps and get a file of about 1.3 GB, with soft text during scrolling. Which change would most likely produce a smaller file with sharper scrolling, and why?
Show answer
Switch the rate control to a quality-based mode, CRF at about 20 for x264 or CQP at about 20 for a hardware encoder. CBR spends the same bits on still frames as on busy frames, so it wastes space on static screens and starves scrolling moments. A quality target spends few bits on still frames and more on motion. The 1.3 GB figure matches the estimate: 6000 kbps for 30 minutes is about 1.35 GB.
Exercise
During a test recording with x264 at the slow preset, OBS shows "Encoding overloaded" and the dropped-frame count climbs. Name two fixes.
Show answer
Use a faster CPU Usage Preset such as veryfast, or switch to a hardware encoder so the CPU is free for the application being demonstrated. Lowering the output resolution or frame rate also reduces the load.