Good day,
My team and I are looking at ways to reduce the overhead from our gstreamer pipeline with the verdin IMX8MP.
We have a yocto build based on
recipes-images/images/tdx-reference-minimal-image.bb
With the following gst and imx imaging related recipes
gstreamer1.0 \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-imx \
imx-gst1.0-plugin \
gstreamer1.0-vaapi \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
imx-codec \
imx-dsp \
imx-vpu-hantro \
imx-vpu-hantro-daemon \
imx-vpuwrap \
imx-codec \
packagegroup-fsl-gstreamer1.0-full \
packagegroup-fsl-tools-gpu \
packagegroup-fsl-tools-gpu-external \
packagegroup-fsl-tools-benchmark \
IMAGE_INSTALL:remove += "packagegroup-fsl-isp"
The pipeline is in 2 parts so we can interface it with our software, the first part, with fakesink replacing appsink when running with GST_DEBUG level 3
v4l2src device=/dev/video2 do-timestamp=true ! video/x-raw,format=UYVY,framerate=30/1,width=1920,height=1080 ! videoconvert ! video/x-raw,format=BGR ! fakesink
We intially see the following errors
ERROR videometa gstvideometa.c:242:default_map: plane 0, no memory at offset 0
ERROR default video-frame.c:168:gst_video_frame_map_id: failed to map video frame plane 0
WARN videofilter gstvideofilter.c:296:gst_video_filter_transform:<videoconvert0> warning: invalid video buffer received
WARNING: from element /GstPipeline:pipeline0/GstVideoConvert:videoconvert0: Internal GStreamer error: code not implemented. Please file a bug at https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/new.
Additional debug info:
/usr/src/debug/gstreamer1.0-plugins-base/1.22.5.imx/gst-libs/gst/video/gstvideofilter.c(296): gst_video_filter_transform (): /GstPipeline:pipeline0/GstVideoConvert:videoconvert0:
invalid video buffer received
Redistribute latency...
ERROR videometa gstvideometa.c:242:default_map: plane 0, no memory at offset 0
ERROR default video-frame.c:168:gst_video_frame_map_id: failed to map video frame plane 0
WARN videofilter gstvideofilter.c:296:gst_video_filter_transform:<videoconvert0> warning: invalid video buffer received
But the pipeline is able to continue as normal with
WARN v4l2src gstv4l2src.c:1353:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 2 - ts: 0:00:03.607138167
every .1 seconds or so, but the pipeline provides images that are able to be handled. Overhead is large however.
Taking a look at the IMX 8 Gstreamer User Guide we noticed that we can leverage DMABUF to reduce the strain on the imx8mp. However, that provides the same initial errors and does not produce any usable data for the second half of the pipeline where we encode
appsrc emit-signals=false ! videoscale ! video/x-raw, format=BGR, height=1080, width=1920 ! "
"videoconvert ! video/x-raw, format=BGRx ! queue ! vpuenc_h264 ! h264parse ! matroskamux ! filesink location=test.mkv
Is there any way for us to leverage the DMA and the vpu encoding such that we minimise the strain on the imx8mp’s cpu?