Skip to main content
Graduate II
July 15, 2025
Question

STM32N6 VENC at lower resolutions

  • July 15, 2025
  • 3 replies
  • 625 views

Hi everyone,

I have successfully deployed the VENC_SDCARD example on the board and can see its feed on my laptop. Now, I want to record it at 480x480 resolution instead of the default 800x480 provided in the example.

I have modified the buffer size, DCMIPP, LTDC configurations, and made a few additional changes. I’m attaching my main.c and stm32n6570_discovery_lcd.c files for your reference.
The following is my camera feed.
Image (1).jpeg

and these are the debug statements in the uart terminal.

Screenshot from 2025-07-15 13-41-14.png

which looks fine to me with no errors.

However, after recording in microSD card and decoding using the ffmpeg command provided in the project's README, I get the following error:

kartikkhandewal@atl-hpzg14-99:~$ ffmpeg -f h264 -framerate 30 -i dump.bin -vf "fps=30" -c:v libx264 -preset veryfast -crf 23 output_fixed.mp4
ffmpeg version 4.4.2-0ubuntu0.22.04.1 Copyright (c) 2000-2021 the FFmpeg developers
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
[h264 @ 0x5c585e5063c0] pps_id 3199971767 out of range
[h264 @ 0x5c585e5063c0] non-existing PPS 0 referenced
 Last message repeated 6 times
[h264 @ 0x5c585e5063c0] pps_id 1206 out of range
[h264 @ 0x5c585e5063c0] non-existing PPS 0 referenced
[h264 @ 0x5c585e5063c0] decode_slice_header error
[h264 @ 0x5c585e5063c0] no frame!
|
- - - - - -
|
 Last message repeated 1 times
[h264 @ 0x5c585e5063c0] decode_slice_header error
[h264 @ 0x5c585e5063c0] no frame!
[h264 @ 0x5c585e4fc340] Stream #0: not enough frames to estimate rate; consider increasing probesize
[h264 @ 0x5c585e4fc340] decoding for stream 0 failed
[h264 @ 0x5c585e4fc340] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, h264, from 'dump.bin':
 Duration: N/A, bitrate: N/A
 Stream #0:0: Video: h264, none, 30 fps, 30 tbr, 1200k tbn, 60 tbc

So how should I proceed from here? Do I need to change some parameters in the VENC function?
Kindly help.

    This topic has been closed for replies.

    3 replies

    athern27Author
    Graduate II
    July 15, 2025

    Can someone move this topic to STM32 MCUs Products forum
    I think it's more appropriate there.

    athern27Author
    Graduate II
    July 21, 2025

    Any updates regarding this

    ST Employee
    July 21, 2025

    Hi,

     

    This example was intended to be simple but, unfortunately, it was also hardcoded.

    Please find attached a slightly modified version.

    I tested it successfully with a resolution of 480x480.

    Hope this helps.

     

    Daniel