[V4L2Camera] Buffer allocation request failed with error: Invalid argument

Hello,
for debugging purposes I would like to pass a custom video via v4l2loopback fed by a gstreamer pipeline to ISAAC’s V4L2Camera. Unfortunately, I keep getting following error:
2020-10-06 14:25:47.456 PANIC packages/sensors/V4L2Camera.cpp@186: [V4L2Camera] Buffer allocation request failed with error: Invalid argument.

The error can be reproduced via:

  • Launching a v4l2-dummy device: modprobe v4l2loopback video_nr=10 exclusive_caps=1 max_buffers=2
  • Feeding data via gstreamer: gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video10
  • Changing device_id in v4l2_camera.app.json to 10
  • Launching V4L2Camera: bazel run //apps/samples/v4l2_camera

My setup:

Would appreciate some help with this.

BR, Chris

Hi Chris,
Maybe it’s because you are not specifying the input format, for example here is my pipeline :
"pipeline": "gst-launch-1.0 -v v4l2src device=/dev/video0 ! avdec_mjpeg ! videoconvert ! video/x-raw,format=RGB,height=480,framerate=30/1 ! appsink name = acquired_image "

I use a MJPEG source, depending on your source compression change this parameter as well as the image size, but I never used loopback so all of this is just a gess.