What does encoding lag mean when recording?

tari3x

New Member
When recording my screen I see the following in the logs:
Code:
info: Output 'simple_ffmpeg_output': Number of lagged frames due to rendering lag/stalls: 193 (16.6%)
info: Video stopped, number of skipped frames due to encoding lag: 10/1163 (0.9%)

I am surprised by this. What I expect to happen is that the frames never get skipped and instead get queued up in my memory until the encoder has time to deal with them. Since I'm not streaming, it does not matter to me what the encoding lag is as long as the encoder gets to each frame eventually. I have 192G of memory, and it is not filling up.

I also don't understand what rendering lag means in this context since I'm not rendering anything. Would someone be able to help?

I am using lossless encoding to utvideo in case that matters. Perhaps there's some buffer size setting I need to tweak?
 

koala

Active Member
OBS' processing of a frame is this:
1. get an empty frame buffer (the "canvas")
2. process every source and paint it on the canvas according to the scene and source configuration
3. give the finished canvas to the encoder frame queue
and encoder thread:
A. get frame from encoder frame queue and encode it
B. write the encoded frame to the output

If with 2. the next frame is due due the fps rate, but compositing hasn't finished because it took too long, a lagged frame is reported. A lagged frame is not rendered, because there isn't enough time to render it. it's skipped.

If with 3. the next frame is due, but encoder frame queue is full, the frame isn't put into it and a skipped frame is reported for the encoder.

Your next question is "I want the encoder frame queue with arbitrary length". Well, that's not how things work. There is a small queue for this asynchronous operation that allows uncoupling between frame producer and frame consumer, so it allows small friction, but it's not meant for a consumer being in general slower than the producer. The design of OBS asks from the user he creates a configuration where the consumer is not slower than the producer.
 
Top