Prior to changing settings, consider if a separate profile should be used. Duplicating the current OBS profile can be done with Profile > Duplicate....
Simple
In the output tab in settings with “Output Mode” set to “Simple”. Use “Lossless Quality” preset on the recording section.
On the advanced tab, set “Color Format” to “I444 (8-bit, 4:4:4, 3 planes)”.
Videos will be recorded in .avi format if this is done.
Advanced lossless H.264
Ensure that in the output tab in settings with “Output Mode” is set to “Advanced”.
Switch over to the “Recording” tab.
Set options in the “Recording Settings” section:
Set options in the “Encoder Settings” section:
On the advanced tab, set “Color Format” to “I444 (8-bit, 4:4:4, 3 planes)”.
Re-encode
Whichever way the video is encoded, it may not exactly be tightly compacted. For this, it may be recommended to re-encode the recorded lossless video.
ffmpeg -i "./input-video.mp4" -codec:v libx264 -codec:a copy -preset placebo -qp 0 "./output-video.mp4"If -preset placebo is too slow. Try -preset veryslow.
Verify (frame extraction)
Check that these lossless videos are in fact lossless. I do this by extracting frames and manually checking them. Using FFmpeg, this command can be used:
ffmpeg -i "./video.mp4" ./frame%04d.png