In look-ahead mode the encoder performs both passes in a single, live encode. Rather than analyzing the whole clip, it looks ahead a fixed window of frames beyond the frame currently being encoded. The statistics gathered from that window are used to insert IDR frames on scene changes and to adjust the QP of each frame based on its complexity and size. Because it only needs a small look-ahead window, this mode runs in real time and operates at the GOP/frame level.
It is enabled with the LookAhead parameter in the control software, or
the look-ahead property on the VCU encoder element in GStreamer. The
value sets the size of the look-ahead window (the number of frames between the two
passes):
- 0: Dual pass disabled (default).
- >= 2: Scene change detection and correction.
- >= 10: Constant quality, using frame complexity together with scene change detection.
The number of frames used specifically for scene change look-ahead can be tuned independently
with the ScnChgLookAhead parameter in the control software (default
3).
Constraints
- A maximum resolution of 4kp30 is supported. The VCU peaks at 4kp60, and looking ahead effectively processes each frame twice, halving the throughput.
- Look-ahead mode requires additional input buffers: the number of look-ahead frames must be added to the encoder's normal input buffer count.
- Due to VCU IP limitations, dual pass is not supported in low latency mode.
- Due to VCU IP limitations, dual pass is not supported for interlaced content.