Hello,
This problem has stumped me for a while, but I am unable to resolve.
I’m currently working with cameras that feature USB 2.0, H.264 hardware-encoded video streams, and I’m facing an issue when trying to set up a UDP stream using GStreamer. Here’s the pipeline I’m using:
gst-launch-1.0 v4l2src device=${device} ! video/x-h264, width=${width}, height=${height} ! h264parse ! queue ! rtph264pay config-interval=10 pt=96 ! udpsink host=${host} port=${port} sync=false
I’ve had successful experiences running multiple cameras on different hardware configurations:
- Raspberry Pi 4 with 4GB RAM can handle up to 5 cameras at 1080p each.
- Nvidia Jetson Nano Developer Kit (2GB RAM) can handle up to 4 cameras at 1080p each.
- Lenovo Desktop, running Ubuntu 22.04.3 LTS, with 16GB RAM and Intel i5-12400, can handle up to 3 cameras at 1080p each.
Multiple cameras are connected via the same USB Hub to each system.
However, when I attempt to add another stream beyond these limits, I encounter the following error:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../sys/v4l2/gstv4l2src.c(759): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.057663072
Setting pipeline to NULL ...
Freeing pipeline ...
Sometimes, I also receive “memory buffer” related errors instead of the “internal data stream error.”
I would greatly appreciate any guidance or insights on how to resolve this issue and potentially increase the number of cameras I can run on these systems. Your assistance would be invaluable.
I have tried this with no resolution: Increase USBFS memory limit in Ubuntu | HalfaGeek
Because I am not changing any variables other than the system/OS, I believe there is an artificial limit on usb memory bandwidth or related being set within gstreamer or the OS itself. I am not sure why the RPi and the Desktop are so drastically different in terms of performance, but I would ideally like to use a higher power system to potentially use even more cameras.
Thank you in advance for your help!