keyframe interval and max b-frames for high FPS recordings

r_ad

New Member
Hey everyone! I'm trying to perfect my obs settings as best as a can and so far it's been going well. I understand most terminology but two settings that I don't really understand very well are "keyframe interval" and "max b frames." It seems like most people recommend leaving both settings at the value of 2 but I'm in a bit of a pickle because I record at a very high fps. Since both of these settings are FPS-related, and most people record at 60 frames per second, it seems like this default value doesn't apply to me. I record at 240 FPS and render at 60 FPS in VEGAS Pro 19 using smart resample and frame blending to give the video a sort of motion blur. If someone could help me understand these settings and how they apply to me that would be great! Thank you!
 

rockbottom

Active Member
Test both, B frames make the recordings soft to my eyes. No more than 2 if you use them.

I do some if not all of my editing with Avidemux before Vegas, so I insert a keyframe every half second. Avidemux works best when cutting on a Keyframe.
 
Last edited:

koala

Active Member
The two parameters deal with quality. They trade off space for quality. If you record with a quality-based rate control such as CQP or CRF, you have infinite space, so you can just optimize for quality if you want. B-frames are the ones with the highest compression (most detail removed), so the more B-frames you insert, the lower the quality. So to optimize B frames for quality, you should use 0 B-frames (none at all) with CQP.
With key frames, it's the same, only on a higher level and the other way round. They contain a whole frame and are an anchor for P-frames, which have a higher higher compression (less detail removed) than the keyframes (but lower than the B-frames). So if you want higher quality, use more keyframes, which can be achieved by using a smaller keyframe interval. It has the side effect that a video with more keyframes is better seekable. With lower keyframe interval, video size increases vastly.

With CBR rate control, the effect is reversed, since you limit the bitrate. To achieve the forced bitrate, the encoder removes as much detail as needed. If you don't use B-frames or use a lower keyframe interval, the bitrate is consumed completely by the bigger frames, so the general quality must be lowered, which is very visible. So don't do this (don't use CBR for recording).
 

r_ad

New Member
The two parameters deal with quality. They trade off space for quality. If you record with a quality-based rate control such as CQP or CRF, you have infinite space, so you can just optimize for quality if you want. B-frames are the ones with the highest compression (most detail removed), so the more B-frames you insert, the lower the quality. So to optimize B frames for quality, you should use 0 B-frames (none at all) with CQP.
With key frames, it's the same, only on a higher level and the other way round. They contain a whole frame and are an anchor for P-frames, which have a higher higher compression (less detail removed) than the keyframes (but lower than the B-frames). So if you want higher quality, use more keyframes, which can be achieved by using a smaller keyframe interval. It has the side effect that a video with more keyframes is better seekable. With lower keyframe interval, video size increases vastly.

With CBR rate control, the effect is reversed, since you limit the bitrate. To achieve the forced bitrate, the encoder removes as much detail as needed. If you don't use B-frames or use a lower keyframe interval, the bitrate is consumed completely by the bigger frames, so the general quality must be lowered, which is very visible. So don't do this (don't use CBR for recording).
ur actually a genius
 

r_ad

New Member
do u have any recommendations for my keyframe interval? keep in mind i record at 240 fps
 

rockbottom

Active Member
With the Simple/Standard outputs the interval is set in seconds (not frames) so 1 or 2 max. 1 will insert a Keyframe every 240 frames, 2 every 480 frames. If you decide you want to insert a Keyframe more often, like every 1/2 second (120 Frames) or 1/4 second (60 Frames) you'll need to learn how to use the Custom FFMPEG Output.
 
Last edited:

r_ad

New Member
With the Simple/Standard outputs the interval is set in seconds (not frames) so 1 or 2 max. 1 will insert a Keyframe every 240 frames, 2 every 480 frames. If you decide you want to insert a Keyframe more often, like every 1/2 second (120 Frames) or 1/4 second (60 Frames) you'll need to learn how to use the Custom FFMPEG Output.
thank u
 

lifeofmikael

New Member
With the Simple/Standard outputs the interval is set in seconds (not frames) so 1 or 2 max. 1 will insert a Keyframe every 240 frames, 2 every 480 frames. If you decide you want to insert a Keyframe more often, like every 1/2 second (120 Frames) or 1/4 second (60 Frames) you'll need to learn how to use the Custom FFMPEG Output.
This is amazing.

Im streaming at 1080p60 with cbr 6K bitrate 2 Keyframes interval and its crisp but when I get into high motion (gaming) it gets blurry, i see other streamers have crisp quality even during high motion, is there anything I can adjust for that?
 

rockbottom

Active Member
There's too many variables, need to see a log so I'm not guessing.

Open OBS & record for a few minutes. Close/re-open OBS & post the previous log.
 

rockbottom

Active Member
I won't be able to help with a Mac. This is Windows Support, post over in the Mac forum. Hopefully somebody over there has been playing around with a similar set-up.
 

rockbottom

Active Member
Kick SE to the curb & start over would be my first suggestion. It's nothing but errors, more than likely the cause of the memory leaks & wasting resources.

Anyway, Color Range is set to Full, this over-saturates colors & makes things look blurry. Change it to partial.

For your encoding settings, use Preset P5 & change Multipass to qres. There are dropped frames so lower the bit-rate on your streams until they cease.

14:28:52.561: Game DVR: On > Off

14:28:52.562: Sec. Software Status:
14:28:52.563: Microsoft Defender Antivirus: disabled (AV)
14:28:52.563: McAfee: enabled (AV) - Sucks, just sayin'
14:28:52.564: Windows Firewall: enabled (FW)
14:28:52.564: McAfee: enabled (FW)

Audio lag indicates that the entire system may be overloaded.
14:47:34.642: Source Desktop Audio audio is lagging (over by 409660.33 ms) at max audio buffering. Restarting source audio.
14:47:34.642: Source Stereo Mix audio is lagging (over by 409660.33 ms) at max audio buffering. Restarting source audio.
19:37:47.825: Source Desktop Audio audio is lagging (over by 50664.07 ms) at max audio buffering. Restarting source audio.
19:37:47.826: Source Stereo Mix audio is lagging (over by 50664.07 ms) at max audio buffering. Restarting source audio.

23:18:34.949: obs-streamelements-core: streaming stop requested by UI control
23:18:37.170: [rtmp stream: 'multi-output'] User stopped the stream
23:18:37.170: [rtmp stream: 'multi-output'] Socket send buffer is 524288 bytes
23:18:37.170: [rtmp stream: 'adv_stream'] User stopped the stream
23:18:37.171: [rtmp stream: 'adv_stream'] Socket send buffer is 1048576 bytes
23:18:37.171: Output 'multi-output': stopping
23:18:37.171: Output 'multi-output': Total frames output: 795639 (797722 attempted)
23:18:37.171: Output 'multi-output': Total drawn frames: 797800 (797838 attempted)
23:18:37.171: Output 'multi-output': Number of lagged frames due to rendering lag/stalls: 38 (0.0%)
23:18:37.171: Output 'multi-output': Number of dropped frames due to insufficient bandwidth/connection stalls: 2083 (0.3%)
23:18:37.171: Output 'adv_stream': stopping
23:18:37.171: Output 'adv_stream': Total frames output: 790197 (797737 attempted)
23:18:37.171: Output 'adv_stream': Total drawn frames: 797791 (797829 attempted)
23:18:37.171: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 38 (0.0%)
23:18:37.171: Output 'adv_stream': Number of dropped frames due to insufficient bandwidth/connection stalls: 7540 (0.9%)
23:18:37.171: [obs-multi-rtmp] Release output while it is active.
23:18:37.171: Video stopped, number of skipped frames due to encoding lag: 47/797797 (0.0%)

00:08:29.259: Number of memory leaks: 73
 

rockbottom

Active Member
Looking at your audio, Global & Source are being used. You should pick one or the other & not use both.

Also "Use Device Timing" for the Stereo Mix (Source) should be disabled, as it's already set for Desktop Audio (Global).

14:28:54.538: [win-wasapi: 'Desktop Audio'] update settings:
14:28:54.538: device id: default
14:28:54.538: use device timing: 1
14:28:54.538: [Loaded global audio device]: 'Desktop Audio'

14:28:54.545: [win-wasapi: 'Stereo Mix'] update settings:
14:28:54.545: device id: {0.0.0.00000000}.{d29eff26-4d65-4b2e-9d7c-9c08c52dc8e0}
14:28:54.545: use device timing: 1
 

rockbottom

Active Member
YW!

I use them when encoding CBR at lower bit-rates only & never more than 2. One of your streams is running high, might not need them. I never use them when recording/encoding CQP.
 

louithe13th

New Member
I’m having the same issue where my stream looks alright but once I start moving a lot it gets blurry is there anything I can do to improve this? I’m using a single pc to stream and game. This is my last recorded log.
16:22:35.673: CPU Name: AMD Ryzen 7 5700G with Radeon Graphics
16:22:35.673: CPU Speed: 3793MHz
16:22:35.673: Physical Cores: 8, Logical Cores: 16
16:22:35.673: Physical Memory: 32609MB Total, 19083MB Free
16:22:35.673: Windows Version: 10.0 Build 22631 (release: 23H2; revision: 4317; 64-bit)
16:22:35.673: Running as administrator: true
16:22:35.673: Windows 10/11 Gaming Features:
16:22:35.673: Game Bar: On
16:22:35.673: Game DVR: On
16:22:35.673: Game DVR Background Recording: On
16:22:35.673: Game Mode: Probably On (no reg key set)
16:22:35.677: Sec. Software Status:
16:22:35.678: Microsoft Defender Antivirus: enabled (AV)
16:22:35.678: Windows Firewall: enabled (FW)
16:22:35.678: Current Date/Time: 2024-10-21, 16:22:35
16:22:35.678: Browser Hardware Acceleration: true
16:22:35.678: Hide OBS windows from screen capture: false
16:22:35.678: Qt Version: 6.6.3 (runtime), 6.6.3 (compiled)
16:22:35.678: Portable mode: false
16:22:35.857: OBS 30.2.3 (64-bit, windows)
16:22:35.857: ---------------------------------
16:22:35.891: ---------------------------------
16:22:35.891: audio settings reset:
16:22:35.891: samples per sec: 48000
16:22:35.891: speakers: 2
16:22:35.891: max buffering: 960 milliseconds
16:22:35.891: buffering type: dynamically increasing
16:22:35.893: ---------------------------------
16:22:35.893: Initializing D3D11...
16:22:35.893: Available Video Adapters:
16:22:35.895: Adapter 0: AMD Radeon RX 7900 XT
16:22:35.895: Dedicated VRAM: 21386928128 (19.9 GiB)
16:22:35.895: Shared VRAM: 17096859648 (15.9 GiB)
16:22:35.895: PCI ID: 1002:744c
16:22:35.895: HAGS Status: Enabled (Default: No, Driver status: Supported)
16:22:35.896: Driver Version: 32.0.12019.1028
16:22:35.896: output 0:
16:22:35.896: name=G32QC A
16:22:35.896: pos={0, 0}
16:22:35.896: size={2560, 1440}
16:22:35.896: attached=true
16:22:35.896: refresh=165
16:22:35.896: bits_per_color=8
16:22:35.896: space=RGB_FULL_G22_NONE_P709
16:22:35.896: primaries=[r=(0.669922, 0.311523), g=(0.278320, 0.660156), b=(0.155273, 0.064453), wp=(0.313477, 0.329102)]
16:22:35.896: relative_gamut_area=[709=1.232380, P3=0.908475, 2020=0.651770]
16:22:35.896: sdr_white_nits=80
16:22:35.896: nit_range=[min=0.124000, max=436.000000, max_full_frame=436.000000]
16:22:35.896: dpi=120 (125%)
16:22:35.896: id=\\?\DISPLAY#GBT3206#7&129d9047&0&UID256#{e6f07b5f-ee97-4a90-b076-33f57bf4eaa7}
16:22:35.896: alt_id=\\.\DISPLAY7
16:22:35.896: Loading up D3D11 on adapter AMD Radeon RX 7900 XT (0)
16:22:35.932: D3D11 loaded successfully, feature level used: b000
16:22:35.932: DXGI increase maximum frame latency success
16:22:35.932: Hardware-Accelerated GPU Scheduling enabled on adapter!
16:22:35.932: D3D11 GPU priority setup success
16:22:36.025: ---------------------------------
16:22:36.025: video settings reset:
16:22:36.025: base resolution: 2560x1440
16:22:36.025: output resolution: 1920x1080
16:22:36.025: downscale filter: Lanczos
16:22:36.025: fps: 60/1
16:22:36.025: format: NV12
16:22:36.025: YUV mode: Rec. 709/Partial
16:22:36.025: NV12 texture support enabled
16:22:36.025: P010 texture support not available
16:22:36.026: Audio monitoring device:
16:22:36.026: name: Default
16:22:36.026: id: default
16:22:36.026: ---------------------------------
16:22:36.029: No AJA devices found, skipping loading AJA UI plugin
16:22:36.029: Failed to initialize module 'aja-output-ui.dll'
16:22:36.031: No AJA devices found, skipping loading AJA plugin
16:22:36.031: Failed to initialize module 'aja.dll'
16:22:36.031: Skipping module '../../obs-plugins/64bit/chrome_elf.dll', not an OBS plugin
16:22:36.032: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded
16:22:36.033: Failed to load 'en-US' text for module: 'decklink-captions.dll'
16:22:36.034: Failed to load 'en-US' text for module: 'decklink-output-ui.dll'
16:22:36.036: A DeckLink iterator could not be created. The DeckLink drivers may not be installed
16:22:36.036: Failed to initialize module 'decklink.dll'
16:22:36.045: Skipping module '../../obs-plugins/64bit/libcef.dll', not an OBS plugin
16:22:36.045: Skipping module '../../obs-plugins/64bit/libEGL.dll', not an OBS plugin
16:22:36.045: Skipping module '../../obs-plugins/64bit/libGLESv2.dll', not an OBS plugin
16:22:36.056: [obs-browser]: Version 2.23.6
16:22:36.056: [obs-browser]: CEF Version 103.0.5060.134 (runtime), 103.0.0-5060-shared-textures.2594+gc69ad37+chromium-103.0.5060.134 (compiled)
16:22:36.176: [noise suppress]: NVIDIA denoiser disabled, redistributable not found or could not be loaded.
16:22:36.176: Failed to get NVVideoEffects.dll version info size
16:22:36.176: [NVIDIA VIDEO FX]: FX disabled, redistributable not found or could not be loaded.
16:22:36.213: [obs-websocket] [obs_module_load] you can haz websockets (Version: 5.5.2 | RPC Version: 1)
16:22:36.213: [obs-websocket] [obs_module_load] Qt version (compile-time): 6.6.3 | Qt version (run-time): 6.6.3
16:22:36.213: [obs-websocket] [obs_module_load] Linked ASIO Version: 103002
16:22:36.222: [obs-websocket] [obs_module_load] Module loaded.
16:22:36.227: [vlc-video]: Couldn't find VLC installation, VLC video source disabled
16:22:36.239: ---------------------------------
16:22:36.240: Loaded Modules:
16:22:36.240: win-wasapi.dll
16:22:36.240: win-dshow.dll
16:22:36.240: win-capture.dll
16:22:36.240: vlc-video.dll
16:22:36.240: text-freetype2.dll
16:22:36.240: rtmp-services.dll
16:22:36.240: obs-x264.dll
16:22:36.240: obs-websocket.dll
16:22:36.240: obs-webrtc.dll
16:22:36.240: obs-vst.dll
16:22:36.240: obs-transitions.dll
16:22:36.240: obs-text.dll
16:22:36.240: obs-qsv11.dll
16:22:36.240: obs-outputs.dll
16:22:36.240: obs-filters.dll
16:22:36.240: obs-ffmpeg.dll
16:22:36.240: obs-browser.dll
16:22:36.240: image-source.dll
16:22:36.240: frontend-tools.dll
16:22:36.240: decklink-output-ui.dll
16:22:36.240: decklink-captions.dll
16:22:36.240: coreaudio-encoder.dll
16:22:36.240: ---------------------------------
16:22:36.240: ---------------------------------
16:22:36.240: Available Encoders:
16:22:36.240: Video Encoders:
16:22:36.240: - ffmpeg_svt_av1 (SVT-AV1)
16:22:36.240: - ffmpeg_aom_av1 (AOM AV1)
16:22:36.240: - h264_texture_amf (AMD HW H.264 (AVC))
16:22:36.240: - h265_texture_amf (AMD HW H.265 (HEVC))
16:22:36.240: - av1_texture_amf (AMD HW AV1)
16:22:36.240: - obs_x264 (x264)
16:22:36.240: Audio Encoders:
16:22:36.240: - ffmpeg_aac (FFmpeg AAC)
16:22:36.240: - ffmpeg_opus (FFmpeg Opus)
16:22:36.240: - ffmpeg_pcm_s16le (FFmpeg PCM (16-bit))
16:22:36.240: - ffmpeg_pcm_s24le (FFmpeg PCM (24-bit))
16:22:36.240: - ffmpeg_pcm_f32le (FFmpeg PCM (32-bit float))
16:22:36.240: - ffmpeg_alac (FFmpeg ALAC (24-bit))
16:22:36.240: - ffmpeg_flac (FFmpeg FLAC (16-bit))
16:22:36.240: ==== Startup complete ===============================================
16:22:36.300: All scene data cleared
16:22:36.300: ------------------------------------------------
16:22:36.302: [win-wasapi: 'Desktop Audio'] update settings:
16:22:36.302: device id: {0.0.0.00000000}.{11cc3448-09d4-4398-a47b-8fee7d3e6871}
16:22:36.302: use device timing: 1
16:22:36.303: [Loaded global audio device]: 'Desktop Audio'
16:22:36.320: WASAPI: Device 'VoiceMeeter Input (VB-Audio VoiceMeeter VAIO)' [48000 Hz] initialized (source: Desktop Audio)
16:22:36.657: [win-wasapi: 'COD (Audio)'] update settings:
16:22:36.657: executable: cod.exe
16:22:36.657: title: Câaâlâlâ âoâfâ âDâuâtâyâ®âââââââââââââââââââââââââââââââââââââââââââââ
16:22:36.657: class: CâOâDââââââââââââââââââââââââââ
16:22:36.657: priority: 2
16:22:36.658: WASAPI: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' [48000 Hz] initialized (source: COD (Audio))
16:22:36.659: [win-wasapi: 'SPOTIFY'] update settings:
16:22:36.659: executable: Spotify.exe
16:22:36.659: title: Spotify Premium
16:22:36.659: class: Chrome_WidgetWin_1
16:22:36.659: priority: 2
16:22:36.660: WASAPI: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' [48000 Hz] initialized (source: SPOTIFY)
16:22:36.660: [game-capture: 'COD'] attempting to hook process: cod.exe
16:22:36.662: Switched to scene 'Scene'
16:22:36.662: ------------------------------------------------
16:22:36.662: Loaded scenes:
16:22:36.662: - scene 'Scene':
16:22:36.662: - source: 'COD' (game_capture)
16:22:36.662: - filter: 'Color Correction' (color_filter_v2)
16:22:36.662: - source: 'SPOTIFY' (wasapi_process_output_capture)
16:22:36.662: - source: 'follow' (browser_source)
16:22:36.662: - source: 'SR' (browser_source)
16:22:36.662: ------------------------------------------------
16:22:36.664: [game-capture: 'COD'] d3d12_init: device=0x256810CCE60
16:22:36.664: [game-capture: 'COD'] DXGI_SWAP_CHAIN_DESC:
16:22:36.664: BufferDesc.Width: 2560
16:22:36.664: BufferDesc.Height: 1440
16:22:36.664: BufferDesc.RefreshRate.Numerator: 165
16:22:36.664: BufferDesc.RefreshRate.Denominator: 1
16:22:36.664: BufferDesc.Format: 24
16:22:36.664: BufferDesc.ScanlineOrdering: 0
16:22:36.664: BufferDesc.Scaling: 0
16:22:36.664: SampleDesc.Count: 1
16:22:36.664: SampleDesc.Quality: 0
16:22:36.664: BufferUsage: 32
16:22:36.664: BufferCount: 2
16:22:36.664: Windowed: 1
16:22:36.664: SwapEffect: 4
16:22:36.664: Flags: 2050
16:22:36.664: [game-capture: 'COD'] We're DXGI1.4 boys!
16:22:36.664: [game-capture: 'COD'] d3d12_init_11on12: creating 11 device: queue=0x2568A0D46B0
16:22:36.677: [game-capture: 'COD'] d3d12 shared texture capture successful
16:22:36.678: [game-capture: 'COD'] shared texture capture successful
16:22:36.678: [win-wasapi: 'COD (Audio)'] update settings:
16:22:36.678: executable: cod.exe
16:22:36.678: title: Câaâlâlâ âoâfâ âDâuâtâyâ®âââââââââââââââââââââââââââââââââââââââââââââ
16:22:36.678: class: CâOâDââââââââââââââââââââââââââ
16:22:36.678: priority: 0
16:22:36.681: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' invalidated. Retrying (source: COD (Audio))
16:22:36.681: WASAPI: Device '[VIRTUAL_AUDIO_DEVICE_PROCESS_LOOPBACK]' [48000 Hz] initialized (source: COD (Audio))
16:22:36.683: [game-capture: 'COD'] Remembering D3D12 queue from present: queue=0x2568A0D46B0
16:22:36.683: [game-capture: 'COD'] Remembering D3D12 queue from first direct submit after present: queue=0x256B26AF330
16:22:36.704: adding 42 milliseconds of audio buffering, total audio buffering is now 42 milliseconds (source: SPOTIFY)
16:22:36.704:
16:22:37.578: [obs-browser: 'follow'] Error: [GraphQL] One or more GraphQL errors were detected on request 01JARP9KA36FCDHTDX9QR1WPDA. AlertsFeatureLaunchFlags: unauthenticated, ActivityListContextV2Query: unauthenticated [object Object],[object Object] (https://assets.twitch.tv/assets/sunlight-overlay-f64dbd127d0b72c13099.js:1)
 
Top