[NVIDIA NVENC H.264 (FFmpeg) encoder: 'advanced_video_stream'] Encoding queue duration surpassed 5 seconds, terminating encoder

adjstreams

New Member
Hello, I'm getting an error popup in OBS for my last 2 streams about 2 and a half hours into the stream, at which point the stream stops. It doesn't cause OBS to crash. What might be the cause? The log shows the error below. I tried searching the forums for "terminating encoder" and "Encoding queue duration surpassed" but no results.

[NVIDIA NVENC H.264 (FFmpeg) encoder: 'advanced_video_stream'] Encoding queue duration surpassed 5 seconds, terminating encoder

Extract from the log (can provide a full log if needed)
Code:
23:16:30.603: effect_setval_inline: invalid data
23:16:32.061: effect_setval_inline: invalid data
23:16:32.195: effect_setval_inline: invalid data
23:16:43.491: Last log entry repeated for 44 more lines
23:16:43.491: [NVIDIA NVENC H.264 (FFmpeg) encoder: 'advanced_video_stream'] Encoding queue duration surpassed 5 seconds, terminating encoder
23:16:43.491: Error encoding with encoder 'advanced_video_stream'
23:16:43.491: Output 'Replay Buffer': stopping
23:16:43.491: Output 'Replay Buffer': Total frames output: 261979
23:16:43.491: Output 'Replay Buffer': Total drawn frames: 257432 (262115 attempted)
23:16:43.492: Output 'Replay Buffer': Number of lagged frames due to rendering lag/stalls: 4683 (1.8%)
23:16:43.494: warning: 2 frames left in the queue on closing
23:16:43.494: warning: 2 frames left in the queue on closing
23:16:43.494: warning: 2 frames left in the queue on closing
23:16:43.494: warning: 2 frames left in the queue on closing
23:16:43.494: warning: 2 frames left in the queue on closing
23:16:43.495: [rtmp stream: 'adv_stream'] Encoder error, disconnecting
23:16:43.495: [rtmp stream: 'adv_stream'] Socket send buffer is 65536 bytes
23:16:43.495: socket_thread_windows: Normal exit
23:16:43.497: Output 'adv_stream': stopping
23:16:43.497: Output 'adv_stream': Total frames output: 261894
23:16:43.497: Output 'adv_stream': Total drawn frames: 257433 (262116 attempted)
23:16:43.497: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 4683 (1.8%)
23:16:43.499: warning: 2 frames left in the queue on closing
 
Use the built in upload feature. Look in OBS help menu. And when you upload the log file, please click on the analize button.
 
the same issue happened to me literally yesterday and as the OP said at about 2.5 hours into the stream. it's the first time it happened to me after updating to OBS 28.
here is the relevant log and the error happened closer to the end:


I've run it through the analizer and it advises all the standard stuff like reducing graphical load on the system, limiting framerates etc. I've done that before just to get a decent performance out of Spider-Man game because it lagged when both streaming and playing.
 
Im also having this issue.
I think since OBS 28.0.2.
Wasnt happening at 28......

I own a 24/7 stream... it crashes every other day .... my PC freezes for a few seconds and boom the stream is stopped!

Code:
21:43:18.566: [NVIDIA NVENC H.264 (FFmpeg) encoder: 'simple_video_stream'] Encoding queue duration surpassed 5 seconds, terminating encoder
21:43:18.566: Error encoding with encoder 'simple_video_stream'
21:43:18.567: [rtmp stream: 'simple_stream'] Encoder error, disconnecting
21:43:18.567: Output 'simple_stream': stopping
21:43:18.567: Output 'simple_stream': Total frames output: 1875160
21:43:18.567: Output 'simple_stream': Total drawn frames: 1875207 (1875382 attempted)
21:43:18.567: Output 'simple_stream': Number of lagged frames due to rendering lag/stalls: 175 (0.0%)
21:43:18.567: [rtmp stream: 'simple_stream'] Freeing 1 remaining packets
21:43:18.567: libfdk_aac encoder destroyed
21:43:18.585: ==== Streaming Stop ================================================
21:43:25.189: ---------------------------------
21:43:25.190: [FFmpeg NVENC encoder: 'simple_video_stream'] settings:
21:43:25.190:     encoder:      NVIDIA NVENC H.264 (FFmpeg)
21:43:25.190:     rate_control: CBR
21:43:25.190:     bitrate:      6000
21:43:25.190:     cqp:          0
21:43:25.190:     keyint:       47
21:43:25.190:     preset:       ll
21:43:25.190:     profile:      high
21:43:25.190:     width:        1920
21:43:25.190:     height:       1080
21:43:25.190:     2-pass:       false
21:43:25.190:     b-frames:     2
21:43:25.190:     psycho-aq:    1
21:43:25.190:     GPU:          0
21:43:25.190:
21:43:25.430: libfdk_aac encoder created
21:43:25.431: libfdk_aac bitrate: 320, channels: 2
21:43:25.431: [rtmp stream: 'simple_stream'] Connecting to RTMP URL rtmp://mrs.contribute.live-video.net/app...
21:43:26.680: [rtmp stream: 'simple_stream'] Connection to rtmp://mrs.contribute.live-video.net/app successful
21:43:26.681: ==== Streaming Start ===============================================
 
I own a 24/7 stream... it crashes every other day .... my PC freezes for a few seconds and boom the stream is stopped!

I've been having issues on my 24/7 stream with the latest update as well, though I think my issue is different from yours.

For me OBS doesn't crash, but just gets progressively worse performance on my RTSP cameras. This might be because I have 32GB of RAM in the streaming system, so perhaps I hadn't hit the max quite yet. (I do restart OBS now and then because of the recent issues, so maybe it is related.)

I had hoped that the memory "fix" that was implemented in 28.0.2 would be my savior (memory leaks over a long runtime has always been an issue) -- but I feel like it's actually worse now. It still leaks memory, I can watch it increase slowly in task manager. On top of that now my stream will get behind, which it never did before. I'll start with next to zero latency to my cloud relay server and it'll slowly ramp up over the next few days until we're nearly 15s behind. On top of this the cameras now do the same thing -- I've woken up to see my outside cam showing it dark still, when we're clearly long past sunrise. Turning off the camera source will lag OBS out as it frees up memory, then I can turn it back on to restore the live view.

These issues were never a problem with the previous releases (I've had my stream up a few years now).
 
Back
Top