There's no encoding lag, just rendering lag/GPU overload, your video is FUBAR before it even gets to the encoder. Audio is lagging really bad too.
20:56:57.714: [rtmp stream: 'adv_stream'] Socket send buffer is 65536 bytes
20:56:58.083: ==== Streaming Start ===============================================
20:57:18.125: [ffmpeg muxer: 'adv_file_output'] Output of file 'E:/Uploaded Videos/Stream footage/2024-04-26_20-56-56.mkv' stopped
20:57:18.126: Output 'adv_file_output': stopping
20:57:18.126: Output 'adv_file_output': Total frames output: 1205
20:57:18.126: Output 'adv_file_output': Total drawn frames: 869 (1282 attempted)
20:57:18.126: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 413 (32.2%)
20:57:18.141: ==== Recording Stop ================================================
20:57:19.355: [rtmp stream: 'adv_stream'] User stopped the stream
20:57:19.355: [rtmp stream: 'adv_stream'] Socket send buffer is 524288 bytes
20:57:19.356: Output 'adv_stream': stopping
20:57:19.356: Output 'adv_stream': Total frames output: 1217
20:57:19.356: Output 'adv_stream': Total drawn frames: 950 (1363 attempted)
20:57:19.356: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 413 (30.3%)
20:57:19.374: ==== Streaming Stop ================================================
22:16:55.935: audio_thread(Audio): min=0.016 ms, median=2.438 ms, max=214.003 ms, 99th percentile=79.112 ms
22:16:55.935: ┗receive_audio: min=0.004 ms, median=1.217 ms, max=127.251 ms, 99th percentile=9.313 ms, 1.22352 calls per parent call
22:16:55.935: ┣buffer_audio: min=0 ms, median=0.002 ms, max=0.623 ms, 99th percentile=0.008 ms
22:16:55.936: ┗do_encode: min=0.027 ms, median=1.206 ms, max=127.243 ms, 99th percentile=9.303 ms
22:16:55.936: ┣encode(Track1): min=0.027 ms, median=1.043 ms, max=28.99 ms, 99th percentile=8.692 ms, 0.676252 calls per parent call
22:16:55.936: ┣send_packet: min=0.001 ms, median=0.084 ms, max=126.37 ms, 99th percentile=1.381 ms
22:16:55.936: ┗encode(adv_stream_audio): min=0.032 ms, median=1.069 ms, max=28.066 ms, 99th percentile=8.913 ms, 0.323748 calls per parent call
22:16:55.936: obs_graphics_thread(16.6833 ms): min=0.075 ms, median=4.025 ms, max=1144.52 ms, 99th percentile=73.711 ms, 72.6698% below 16.683 ms
22:16:55.936: ┣tick_sources: min=0.001 ms, median=0.035 ms, max=1144.35 ms, 99th percentile=0.158 ms
22:16:55.936: ┣output_frame: min=0.055 ms, median=3.101 ms, max=218.157 ms, 99th percentile=72.836 ms
From the items above only 1 & 3 are needed (Game Mode/Fix your Scenes) but I also recommend QSV to reduce the load on the CPU. It will have no trouble encoding two streams & the quality will be better as well since you're using Ultrafast with x264.
Add:
Update your iGPU driver, it's over a year old.
Uncheck Scaling on the recording tab.
Disable AVAST if things are still lagging.