Question / Help Uncompressed buffer for x264 CRF local recording?

And G

New Member
I'm locally recording a game with x264 CRF. This works fine in general, but whenever there's a lot of camera shaking the encoder (well, my CPU) can't seem to keep up and starts dropping frames. The game remains smooth, but the output video has duplicate/missing frames.

Obviously, in this situation the encoder should push frames without compression (i.e. in RGB24) directly to the RAM, which requires very little processing, and encode them later once all older frames have been processed.

I cannot find this option in OBS. Even when recording via the replay buffer, it seems that all frames are encoded before being stored in memory, and whenever the encoder can't keep up with the source, frames simply get dropped rather than buffered.

So, how do I enable uncompressed (CPU-light) buffering for x264 CRF recording?
 

And G

New Member
Ultrafast.

I'm aware that I can get better results by upgrading hardware or recording at different settings. My question specifically concerns CRF buffering.
 

R1CH

Forum Admin
Developer
OBS discards frames if the encoder gets behind realtime. There is no option to buffer them, however it is definitely something worth adding.
 

sam686

Member
h264 might require super powerful CPU for lossless.

Try custom ffmpeg output, there is a lot of them to choose from.

container AVI, show all codes, video: rawvideo, audio: s16le... but be warned that rawvideo requires a super fast storage like SSD, or a raid0 or sripped volume storage. Too slow of storage might freeze the computer if using 64-bit OBS-Studio, or crash 32-bit OBS-Studio.
You can try other lossless video codes like huffyuv or utvideo.

Advanced, color format RGB if you want full color resolution without color blur. Some codecs requires RGB, others may require NV12.
Some codecs requires specific containers, turn off "Show all codecs" to hide incompatible codecs.
 

And G

New Member
OBS discards frames if the encoder gets behind realtime. There is no option to buffer them, however it is definitely something worth adding.

I see. I agree that this should be added, considering that RAM is cheap nowadays and writing RGB24 frames to RAM requires basically no processing power, which is much more of a bottleneck than RAM when recording (especially games). At 1920x1080 and 60 fps, buffering one second would require 356 MB RAM which is practically nothing, and one second of source video should be more than enough to deal with any lag spikes.

Especially for shorter recordings this would be great. In my case, with 24 out of 32 GB RAM free at pretty much all times, I would be able to record a full minute at 60 fps 1920x1080 without the encoder putting strain on the CPU at all. So I could have high fps in the game, excellent visual quality output, and a small filesize.

Really hoping you add this.

h264 might require super powerful CPU for lossless..

I don't want lossless output, I want lossless buffering. This wouldn't involve encoding at all, since it would be handled by the interface between the source and the encoder (in this case OBS).
 
Last edited:
Top