Skip to main content
ypiotrp
Associate III
July 14, 2026
Question

STM32N6 VENC: Image overexposure (white screen) in low light

  • July 14, 2026
  • 1 reply
  • 86 views

I am experiencing a critical issue with the hardware video encoder (VENC) on the STM32N6 when processing low-light frames.

Setup:

  • Sensor: IMX335 connected to STM32N6

  • Capture Pipeline: DCMIPP configured in 1080p@15FPS capturing and writing to RAM in RGB565 format.

  • Encoder Input: The same RGB565 buffers are passed to the VENC.

  • Storage: The encoded H.264 stream is saved directly to an SD card.

The Problem:

When the camera enters a dark environment (very low-light conditions) and I manually reduce the Gain/Exposure to very low values (where the image should be almost completely black), the video recorded on the SD card starts to progressively brighten up until it becomes completely white (a "flashbang" effect).

When playing back the file on a PC, the transition from black to fully white takes about 1-2 seconds (accumulating over several frames).

Key Observations & What I've Already Tested:

  1. DCMIPP Output is OK: I have a live preview on an LCD screen displaying the input buffers directly from RAM (written by DCMIPP) before they enter the encoder. This live preview remains perfectly dark and correct at all times. The issue is strictly visible only in the recorded file played back from the SD card.

  2. Interesting behavior when changing Gain: If the image is already fully blown out (white) in the recording, sending an I2C command to the sensor to change the Gain (e.g., from 20000 to 14000) temporarily restores the correct dark image for a fraction of a second (possibly 1 frame) in the recorded file, after which it immediately starts accumulating the white/bright error again.

My Questions:

  1. What could be causing this specific problem?

  2. Are there any known workarounds or solutions for this issue?

  3. If not, what else can I do or test to further narrow down the root cause of this problem?

Regards,
Piotr

1 reply

ypiotrp
ypiotrpAuthor
Associate III
July 14, 2026

Here is a video that VENC recorded on my SD card: