Post processing with libcamera-still fails

I’ve been reading the Raspi documentation regarding libcamera and found out about the post processing stage. When trying to run a capture with a post processing file (predefined example script from the raspberry github) I get this error:

pi@rpi3b:~ $ libcamera-still -n -o test.jpg --post-process-file ~/pp-hdr.json
[0:04:10.510872359] [2001]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3416-179ef58c
[0:04:10.539602449] [2002]  WARN CameraSensorProperties camera_sensor_properties.cpp:141 No static properties available for 'imx519'
[0:04:10.539739320] [2002]  WARN CameraSensorProperties camera_sensor_properties.cpp:143 Please consider updating the camera sensor properties database
[0:04:10.539826922] [2002] ERROR CameraSensor camera_sensor.cpp:551 'imx519 10-001a': Camera sensor does not support test pattern modes.
[0:04:10.604310252] [2002]  WARN RPI raspberrypi.cpp:1233 Mismatch between Unicam and CamHelper for embedded data usage!
[0:04:10.606245202] [2002] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:04:10.606821073] [2002]  INFO RPI raspberrypi.cpp:1356 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media2 and ISP device /dev/media0
Reading post processing stage "hdr"
[0:04:10.610180100] [2001]  INFO Camera camera.cpp:1028 configuring streams: (0) 2328x1748-YUV420
[0:04:10.610701649] [2002]  INFO RPI raspberrypi.cpp:751 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 2328x1748-SRGGB10_1X10 - Selected unicam format: 2328x1748-pRAA
[0:04:10.711968818] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: Saturation = 1.000000
[0:04:10.712159647] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: Contrast = 1.000000
[0:04:10.712213552] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: Brightness = 0.000000
[0:04:10.712257613] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: AwbMode = 0
[0:04:10.712302247] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: Sharpness = 1.000000
[0:04:10.712346934] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: ExposureValue = 0.000000
[0:04:10.712422765] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: AeExposureMode = 0
[0:04:10.712464951] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: FrameDurationLimits = [ 33333, 33333 ]
[0:04:10.712521408] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: AeMeteringMode = 0
[0:04:10.712562293] [2007]  INFO IPARPI raspberrypi.cpp:666 Request ctrl: NoiseReductionMode = 3
[0:04:15.963001091] [2001]  INFO Camera camera.cpp:1028 configuring streams: (0) 4656x3496-YUV420 (1) 4656x3496-SRGGB10_CSI2P
[0:04:15.963892581] [2002]  INFO RPI raspberrypi.cpp:751 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 4656x3496-SRGGB10_1X10 - Selected unicam format: 4656x3496-pRAA
[0:04:16.208312561] [2002] ERROR V4L2 v4l2_videodevice.cpp:1179 /dev/video0[12:cap]: Unable to request 3 buffers: Cannot allocate memory
ERROR: *** failed to allocate capture buffers ***

What is happening here? I would love to experiment with postprocessing, so any hints enabling me to get this working are welcome…

Thanks, Chris

From the log you can see that this is a memory allocation failure error, when you run hdr postprocessing with 16MP, the current memory is not enough, you can reduce the resolution, or increase the memory:

dtoverlay=vc4-kms-v3d,cma-512 #Tested on Pi4 8GB.
1 Like