Hey all,
I've been troubleshooting this issue for the past few days, looking for every bit of help I can get. I am trying to configure a 4k streaming profile, current settings:
Issue:
After a few minutes (can be 1 minute, can be 15 minutes, can be even 30 minutes) GPU encode seems to start lagging behind severely up to a point where every new frame is skipped due to the encoding lag, even though it's set on laughable bitrates (10k stream, 5k recording). Same is on 50k/25k accordingly, no clear dependency on the values, seems random.
This is present on both capture card passthrough from a PS5 via an Elgato 4K60 Mk.2 and on-device 4090 FE 4k gameplay. Even if it's capped to 30FPS output, even with Raytracing disabled.
On-device screenshot: https://i.imgur.com/vKFNW2Z.png, video: https://youtu.be/AWuggNhQ1TI
PS5 screenshot: https://i.imgur.com/iUfxNea.png, video: https://youtu.be/3QG9YRsBJaw
(Sorry about the crap quality, but one can clearly see encoding lag out of control and the fact that in some of these the Video Engine Load is pegged at 100% and GPU is not even at 50%)
As you can see from the videos, whenever the encoding lag starts to creep up the Task Manager view of the Encode utilization switches from very stable to spotty and ultimately stops being stable 70% but rather jumps between 50 and 70%, which I feel is the only thing other than GPU-Z GPU Load spike that indicates an encoding lag.
Spec:
- AMD 5800X3D
- 64GB of 3600 CL16 DDR4 RAM (G.Skill Trident Z)
- RTX 4090 FE
- Corsair RM750X 2018 (a weak link, yes, but don't dismiss it for it)
- Fractal Meshify 2 with 9 fans (no lack of cooling)
- RAID0 Intel 660p 2TBx2 SSDs (hardware raid, AMD board. Does not change if it's recorded to a 970 Evo 1TB direct access) for the recording destination
- Both mild overclock (98.7% TimeSpy Stress Test) AND Stock. OC for PS5, Stock for Witcher.
More logs:
- Witcher PC run:
I've been troubleshooting this issue for the past few days, looking for every bit of help I can get. I am trying to configure a 4k streaming profile, current settings:
02:31:31.621: obs_output_set_audio_encoder: Null 'output' parameter
02:31:31.621: output 'adv_stream' (rtmp_output) created
02:31:31.661: [jim-nvenc: 'advanced_video_stream'] settings:
02:31:31.661: codec: H264
02:31:31.661: rate_control: CBR
02:31:31.661: bitrate: 10000
02:31:31.661: cqp: 20
02:31:31.661: keyint: 120
02:31:31.661: preset: p6
02:31:31.661: tuning: hq
02:31:31.661: multipass: disabled
02:31:31.661: profile: high
02:31:31.661: width: 3840
02:31:31.661: height: 2160
02:31:31.661: b-frames: 2
02:31:31.661: lookahead: true
02:31:31.661: psycho_aq: true
02:31:31.661:
02:31:31.777: ---------------------------------
02:31:31.778: [FFmpeg aac encoder: 'adv_stream_aac'] bitrate: 160, channels: 2, channel_layout: stereo
02:31:31.778:
02:31:31.781: [rtmp stream: 'adv_stream'] Connecting to RTMP URL rtmps://a.rtmps.youtube.com:443/live2...
02:31:31.782: rtmp-common.c: [open_json_file] Wrong format version (3), expected 4
02:31:31.784: rtmp-common.c: [open_json_file] Wrong format version (3), expected 4
02:31:31.808: [jim-nvenc: 'advanced_video_recording'] settings:
02:31:31.808: codec: AV1
02:31:31.808: rate_control: CBR
02:31:31.808: bitrate: 5000
02:31:31.808: cqp: 20
02:31:31.808: keyint: 120
02:31:31.808: preset: p6
02:31:31.808: tuning: hq
02:31:31.808: multipass: disabled
02:31:31.808: profile: main
02:31:31.808: width: 3840
02:31:31.808: height: 2160
02:31:31.808: b-frames: 2
02:31:31.808: lookahead: false
02:31:31.808: psycho_aq: true
02:31:31.808:
02:31:31.833: [rtmp stream: 'adv_stream'] Interface: Intel(R) I211 Gigabit Network Connection (ethernet, 1000 mbps)
02:31:31.930: ---------------------------------
02:31:31.930: [FFmpeg aac encoder: 'Track1'] bitrate: 320, channels: 2, channel_layout: stereo
Issue:
After a few minutes (can be 1 minute, can be 15 minutes, can be even 30 minutes) GPU encode seems to start lagging behind severely up to a point where every new frame is skipped due to the encoding lag, even though it's set on laughable bitrates (10k stream, 5k recording). Same is on 50k/25k accordingly, no clear dependency on the values, seems random.
This is present on both capture card passthrough from a PS5 via an Elgato 4K60 Mk.2 and on-device 4090 FE 4k gameplay. Even if it's capped to 30FPS output, even with Raytracing disabled.
On-device screenshot: https://i.imgur.com/vKFNW2Z.png, video: https://youtu.be/AWuggNhQ1TI
PS5 screenshot: https://i.imgur.com/iUfxNea.png, video: https://youtu.be/3QG9YRsBJaw
(Sorry about the crap quality, but one can clearly see encoding lag out of control and the fact that in some of these the Video Engine Load is pegged at 100% and GPU is not even at 50%)
As you can see from the videos, whenever the encoding lag starts to creep up the Task Manager view of the Encode utilization switches from very stable to spotty and ultimately stops being stable 70% but rather jumps between 50 and 70%, which I feel is the only thing other than GPU-Z GPU Load spike that indicates an encoding lag.
Spec:
- AMD 5800X3D
- 64GB of 3600 CL16 DDR4 RAM (G.Skill Trident Z)
- RTX 4090 FE
- Corsair RM750X 2018 (a weak link, yes, but don't dismiss it for it)
- Fractal Meshify 2 with 9 fans (no lack of cooling)
- RAID0 Intel 660p 2TBx2 SSDs (hardware raid, AMD board. Does not change if it's recorded to a 970 Evo 1TB direct access) for the recording destination
- Both mild overclock (98.7% TimeSpy Stress Test) AND Stock. OC for PS5, Stock for Witcher.
More logs:
- Witcher PC run:
- Valhalla PS5 run:02:31:31.958: ==== Recording Start ===============================================
02:31:31.959: [ffmpeg muxer: 'adv_file_output'] Writing file 'D:/Recordings/OBS/2023-01-14 02-31-31.mkv'...
02:31:32.267: [rtmp stream: 'adv_stream'] Connection to rtmps://a.rtmps.youtube.com:443/live2 successful
02:31:32.267: ==== Streaming Start ===============================================
02:31:32.267: [rtmp stream: 'adv_stream'] Socket send buffer is 65536 bytes
02:33:44.673: warning: EOI missing, emulating
02:37:33.200: warning: EOI missing, emulating
02:38:58.293: [ffmpeg muxer: 'adv_file_output'] Output of file 'D:/Recordings/OBS/2023-01-14 02-31-31.mkv' stopped
02:38:58.293: Output 'adv_file_output': stopping
02:38:58.293: Output 'adv_file_output': Total frames output: 26348
02:38:58.293: Output 'adv_file_output': Total drawn frames: 26777 (26780 attempted)
02:38:58.293: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 3 (0.0%)
02:38:58.293: ==== Recording Stop ================================================
02:38:58.409: warning: 2 frames left in the queue on closing
02:38:58.448: [rtmp stream: 'adv_stream'] User stopped the stream
02:38:58.448: [rtmp stream: 'adv_stream'] Socket send buffer is 2097152 bytes
02:38:58.448: Output 'adv_stream': stopping
02:38:58.448: Output 'adv_stream': Total frames output: 26329
02:38:58.448: Output 'adv_stream': Total drawn frames: 26797 (26800 attempted)
02:38:58.448: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 3 (0.0%)
02:38:58.449: Video stopped, number of skipped frames due to encoding lag: 4934/26387 (18.7%)
02:38:58.449: [rtmp stream: 'adv_stream'] Freeing 1 remaining packets
02:38:58.457: ==== Streaming Stop ================================================
23:16:23.669: ==== Recording Start ===============================================
23:16:23.669: [ffmpeg muxer: 'adv_file_output'] Writing file 'D:/Recordings/OBS/2023-01-13 23-16-23.mkv'...
23:16:24.013: [rtmp stream: 'adv_stream'] Connection to rtmps://a.rtmps.youtube.com:443/live2 successful
23:16:24.013: [rtmp stream: 'adv_stream'] Socket send buffer is 65536 bytes
23:16:24.013: ==== Streaming Start ===============================================
23:20:54.376: [ffmpeg muxer: 'adv_file_output'] Output of file 'D:/Recordings/OBS/2023-01-13 23-16-23.mkv' stopped
23:20:54.376: Output 'adv_file_output': stopping
23:20:54.376: Output 'adv_file_output': Total frames output: 15434
23:20:54.376: Output 'adv_file_output': Total drawn frames: 16242
23:20:54.376: ==== Recording Stop ================================================
23:20:54.455: warning: 2 frames left in the queue on closing
23:20:55.431: [rtmp stream: 'adv_stream'] User stopped the stream
23:20:55.431: [rtmp stream: 'adv_stream'] Socket send buffer is 2097152 bytes
23:20:55.431: Output 'adv_stream': stopping
23:20:55.431: Output 'adv_stream': Total frames output: 15473
23:20:55.431: Output 'adv_stream': Total drawn frames: 16312
23:20:55.432: Video stopped, number of skipped frames due to encoding lag: 4154/15524 (26.8%)
23:20:55.432: [rtmp stream: 'adv_stream'] Freeing 2 remaining packets
23:20:55.444: ==== Streaming Stop ================================================