GstV4l2Src:v4l2src0: 分配所需内存失败 我们正在通过 ADV7280A-M M IPI CSI-2 和 Yocto Linux Scarthgap 和 Qt 6.8.2 使用带有模拟视频的 i .MX 8X。 下列作品 gst-用上市,不用发布-1.0v4l2src 设备=/dev/video2!video/x-raw,width=720,height=567,framerate=25/1 !自动视频水槽 但是,Qt 中的相应功能不起作用(gst_parse_element_make: no element"video" )。 因此,我正在努力: gst-用上市,不用发布-1.0-vvv v4l2src 设备=/dev/video2!rawvideoparse width=720 height=576 format=yuy2 !自动视频水槽 然而,由于 ERROR:from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory. 全部输出为 将管道设置为 PAUSED ... 错误:XDG_RUNTIME_DIR 无效或未在环境中设置。 错误:XDG_RUNTIME_DIR 无效或未在环境中设置。 EGL: 警告:wayland 上不支持默认显示 EGL: Warning:wayland 上没有默认显示支持 管道已上线,不需要 PREROLL ... /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstKMSSink:autovideosink0-actual-sink-kms: display-width = 1280 /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstKMSSink:autovideosink0-actual-sink-kms: display-height = 768 管道已 PREROLLED .... 设置管道为播放状态 ... 新时钟:GstSystemClock /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1 /GstPipeline:pipeline0/GstRawVideoParse:rawvideoparse0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)3840, height=(int)2160, framerate=(fraction)120/1, interlace-mode=(string)progressive, colorimetry=(string)1:4:5:1 ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory. 其他调试信息: /usr/src/debug/gstreamer1.0-plugins-good/1.24.0.imx/sys/v4l2/gstv4l2src.c(955): gst_v4l2src_decide_allocation ():/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: 缓冲池激活失败 0:00:00.043197264 后执行结束 将管道设置为 NULL ... ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. 附加调试信息: /usr/src/debug/gstreamer1.0/1.24.0.imx/libs/gst/base/gstbasesrc.c(3175):gst_base_src_loop ():/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) Freeing pipeline ... 谢谢 -- 彼得 i.MX 8 系列 | i.MX 8QuadMax (8QM) | 8QuadPlus Linux 多媒体 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 嗨 @joanxie, GST_DEBUG=3 gst-用上市-1.0-v v4l2src num-buffers=5 设备=/dev/video0!video/x-raw,format=GRAY8,depth=8,width=1280,height=800 !视频转换 !jpegenc !multifilesink location=ar0144_mono_image.jpg issue is Starting GStreamer pipeline... Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Pipeline is PREROLLED ... 将管道设置为正在播放 ... 0:00:00.244283375 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 0:00:00.244416875 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5230:gst_v4l2_object_probe_caps: 使用 VIDIOC_CROPCAP 探测像素宽高比失败:参数无效 新时钟:GstSystemClock 0:00:00.246845250 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 /GstPipeline:pipeline0/GstV4l2Src:v4l2src0。GstPad:src: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressie /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progre /GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:sink:caps = video/x-raw,format=(string)GRAY8,depth=(int)8,width=(int)1280,height=(int)800,framerate=(fraction)120/1,interlace-mode=(string)progressive /GstPipeline:pipeline0/GstVideoConvert:videoconvert0。GstPad:sink: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)proge /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progresse 0:00:00.253795500 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 0:00:00.253877250 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 0:00:00.259326750 784 0xffffb4000b70 ERROR v4l2bufferpool gstv4l2bufferpool.c:721:gst_v4l2_buffer_pool_streamon: STREAMON 32 出错(管道断裂) 0:00:00.259393750 784 0xffffb4000b70 ERROR bufferpool gstbufferpool.c:572:gst_buffer_pool_set_active: start failed 0:00:00.259435250 784 0xffffb4000b70 WARN v4l2src gstv4l2src.c:955:gst_v4l2src_decide_allocation: 错误:分配所需内存失败。 0:00:00.259461750 784 0xffffb4000b70 WARN v4l2src gstv4l2src.c:955:gst_v4l2src_decide_allocation: 错误:缓冲池激活失败 ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory. 其他调试信息: /usr/src/debug/gstreamer1.0-plugins-good/1.24.0.imx/sys/v4l2/gstv4l2src.c(955): gst_v4l2src_decide_allocation ():/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: 缓冲池激活失败 0:00:00.259690375 784 0xffffb4000b70 WARN basesrc gstbasesrc.c:3395:gst_base_src_prepare_allocation: 子类未能决定分配 执行在 0:00:00.015445250 后结束 将管道设置为 NULL ... 0:00:00.259771000 784 0xffffb4000b70 WARN basesrc gstbasesrc.c:3175:gst_base_src_loop: 错误:内部数据流错误。 0:00:00.259796500 784 0xffffb4000b70 WARN basesrc gstbasesrc.c:3175:gst_base_src_loop: error: streaming stopped, reason not-negotiated (-4) ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. 附加调试信息: /usr/src/debug/gstreamer1.0/1.24.0.imx/libs/gst/base/gstbasesrc.c(3175):gst_base_src_loop ():/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) Freeing pipeline ... GStreamer 命令完成。 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 为了完整性,这个话题最初的问题是使用 capsfilter 解决的,而不是 rawvideoparse: player.source = " gstreamer-pipeline:v4l2src 设备=/dev/video2!capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1" 与 Qt 一起使用时,gst_v4l2_object_fill_format_list 中确实会出现间歇性 SIGSEGV,但我想这是另一个问题。 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 你好@Ahmed230,你的留言字体太大,难以阅读。 此主题是关于 ADV7280A-M(NTSC/PAL)在以下情况下工作正常:"!视频/x-原始......" ,但不是用:"!rawvideoparse..." 您的留言是关于 AR0144 图像传感器无法使用:"!video/x-raw". 不同的主题。最好新建一个帖子,然后按 Ctrl+Shift+V 只粘贴文本,不粘贴大字体。 同时将 $NUMBER_OF_PIC、$VID_DEVICE 和 $FRAME_SIZE 替换为实际值。 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 我的问题是 imx8mm 主板上的 camera ar0144 的恩智浦 6.6.36 内核用于捕获图像或视频 GST_DEBUG=3 gst-launch-1.0-v v4l2src num-buffers=$number_of_PIC device=$vid_device=$vid_device!video/x-raw,format=GRAY8,depth=8,$FRAME_SIZE !videoconvert ! jpegenc !multifilesink location=ar0144_mono_image.jpg Starting GStreamer pipeline... Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Pipeline is PREROLLED ... 将管道设置为正在播放 ... 0:00:00.244283375 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 0:00:00.244416875 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5230:gst_v4l2_object_probe_caps: 使用 VIDIOC_CROPCAP 探测像素宽高比失败:参数无效 新时钟:GstSystemClock 0:00:00.246845250 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 /GstPipeline:pipeline0/GstV4l2Src:v4l2src0。GstPad:src: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressive /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progressie /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progre /GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:sink:caps = video/x-raw,format=(string)GRAY8,depth=(int)8,width=(int)1280,height=(int)800,framerate=(fraction)120/1,interlace-mode=(string)progressive /GstPipeline:pipeline0/GstVideoConvert:videoconvert0。GstPad:sink: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)proge /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)GRAY8, depth=(int)8, width=(int)1280, height=(int)800, framerate=(fraction)120/1, interlace-mode=(string)progresse 0:00:00.253795500 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 0:00:00.253877250 784 0xffffb4000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect: 使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 0:00:00.259326750 784 0xffffb4000b70 ERROR v4l2bufferpool gstv4l2bufferpool.c:721:gst_v4l2_buffer_pool_streamon: STREAMON 32 出错(管道断裂) 0:00:00.259393750 784 0xffffb4000b70 ERROR bufferpool gstbufferpool.c:572:gst_buffer_pool_set_active: start failed 0:00:00.259435250 784 0xffffb4000b70 WARN v4l2src gstv4l2src.c:955:gst_v4l2src_decide_allocation: 错误:分配所需内存失败。 0:00:00.259461750 784 0xffffb4000b70 WARN v4l2src gstv4l2src.c:955:gst_v4l2src_decide_allocation: 错误:缓冲池激活失败 ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory. 其他调试信息: /usr/src/debug/gstreamer1.0-plugins-good/1.24.0.imx/sys/v4l2/gstv4l2src.c(955): gst_v4l2src_decide_allocation ():/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: 缓冲池激活失败 0:00:00.259690375 784 0xffffb4000b70 WARN basesrc gstbasesrc.c:3395:gst_base_src_prepare_allocation: 子类未能决定分配 执行在 0:00:00.015445250 后结束 将管道设置为 NULL ... 0:00:00.259771000 784 0xffffb4000b70 WARN basesrc gstbasesrc.c:3175:gst_base_src_loop: 错误:内部数据流错误。 0:00:00.259796500 784 0xffffb4000b70 WARN basesrc gstbasesrc.c:3175:gst_base_src_loop: error: streaming stopped, reason not-negotiated (-4) ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error. 附加调试信息: /usr/src/debug/gstreamer1.0/1.24.0.imx/libs/gst/base/gstbasesrc.c(3175):gst_base_src_loop ():/GstPipeline:pipeline0/GstV4l2Src:v4l2src0: streaming stopped, reason not-negotiated (-4) Freeing pipeline ... GStreamer 命令完成。 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 这一次,您得到了哪些打印错误信息? 我将电路板支持包 6.6 与电路板支持包 5.10 进行了比较,电路板支持包 6.6 从基于这个补丁的 5.10 中删除了代码,你试过电路板支持包 5.10 了吗?
https://github.com/nxptest/linux-imx/commit/4f87610383a0f365ee0c68d9354ddcf099240144 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory PS@joanxie RE: 0:00:00.518350875 427 0xffff80000b70 WARN v4l2 gstv4l2object.c:5023:gst_v4l2_object_get_crop_rect:v4l2src0:src使用 VIDIOC_G_SELECTION 获取默认裁剪矩形失败:参数无效 这是因为在调用 mxc_isi_cap_g_selection() 时: 类型 1 V4L2_BUF_TYPE_VIDEO_CAPTURE 和 目标 1 V4L2_SEL_TGT_CROP_DEFAULT(和目标 2 V4L2_SEL_TGT_CROP_BOUNDS) ,但只期待类型 V4L2_BUF_TYPE_VIDEO_OUTPUT 或 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/drivers/staging/media/imx/imx8-isi-cap.c#L1164 添加处理程序后,警告就会消失。 (但随后 mxc_isi_cap_s_fmt_mplane 被调用 ,不知何故 fmt 从 RGB565 720x480 变为 YUYV-16 3840x2160)。 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 你好@joanxie 我们使用 Yocto Scarthgap 和 linux-imx uname 显示 6.6.52 本次提交后,我们从 linux-imx 分支: https://github.com/nxp-imx/linux-imx/commit/e0f9e2afd4cff3f02d71891244b4aa5899dfc786 如果我在 drivers/staging/media/imx/imx8-mipi-csi2.c mxc_csi2_get_sensor_fmt() 中添加调试程序,则会显示 720 x 480。 因此,我对 v4l2-ctl --get-fmt-video -d /dev/video2 显示 3840/2160 感到困惑,不知道是否应在某处实现 VIDIOC_G_SELECTION 或 VIDIOC_CROPCAP,以提高一致性。 谢谢 -- 彼得 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 你用的是什么版本的电路板支持包?看来是比例问题,这就是为什么我要求你测试特定的分辨率,否则需要升级到3840,这会导致错误 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory @joanxie 你好,谢谢你的回复。 v4l2-ctl -d /dev/v4l-subdev1 --set-standard PAL 使用 "video/x-raw, width=720, height=480" 用上市 gst-launch-1.0。 但问题是 在 Qt 6.8.2 (QML MediaPlayer) 的 gstreamer-pipeline: 中使用 video/x-raw 会失败: ERROR GST_PIPELINE grammar.y:630:gst_parse_element_make:无元素"视频" 在 Qt 下(使用 playbin),video/x-raw 不能被识别为一个元素,因为它是一个 caps 过滤器。 这就是为什么我试图在不需要视频/x-原始盖帽过滤器的情况下让管道正常工作的原因 好吧,我刚刚发现有一个 capsfilter 元素,所以就用它来代替: player.source = " gstreamer-pipeline:v4l2src 设备=/dev/video2!capsfilter caps=video/x-raw,width=720,height=480,framerate=25/1" 从 Qt 上几乎可以运行。视频显示了一会儿,但随后就出现了故障: 1 format_cmp_func gstv4l2object.c1276 0xffffd80668dc 2 g_slist_insert_sorted_real gslist.c913 0xfffff604fab4 3 g_slist_insert_sorted gslist.c964 0xfffff60504e0 4 gst_v4l2_object_fill_format_list gstv4l2object.c1324 0xffffd8065a60 5 gst_v4l2_object_get_format_list gstv4l2object.c1373 0xffffd8065f2c 6 gst_v4l2_object_probe_caps gstv4l2object.c5212 0xffffd806ed34 7 gst_v4l2_object_get_caps gstv4l2object.c5310 0xffffd806ef38 8 gst_base_src_default_query gstbasesrc.c1373 0xffffd9219490 9 gst_pad_query gstpad.c4228 0xffffd90ec24c 10 gst_pad_query_caps gstutils.c3117 0xffffd913140c 11 gst_v4l2src_negotiate gstv4l2src.c786 0xffffd8079a04 12 gst_base_src_negotiate_unlocked gstbasesrc.c3490 0xffffd9213e9c 13 gst_base_src_loop gstbasesrc.c2915 0xffffd9215e7c 14 gst_task_func gsttask.c399 0xffffd9122090 15 g_thread_pool_thread_proxy gthreadpool.c350 0xfffff605d780 16 g_thread_proxy gthread.c831 0xfffff605cad8 17 start_thread pthread_create.c447 0xfffff6730fc4 18 thread_start clone3.S 76 0xfffff67931cc 看看我能想出什么办法。 无论如何,我都想知道: v4l2-ctl--设备 /设备/video2--all 给出 mxc-isi-cap_v1 宽度/高度:3840/2160... 猜猜吧,因为尽管 ADV 的宽度只能达到 720,但 MIPI CSI-2 的宽度为 3840。 这样做可以改变它,但只是暂时的: v4l2-ctl -d /dev/video2 -vwidth=720,height=480 在不使用 capsfilter 的情况下运行 gstreamer 时,它会恢复到 3840。 从我们基于 i.MX 8X 的板上看,MIPI CSI-2 是硬接线到 ADV 的,并且只能作为 720 宽度使用,有什么办法可以将其配置为保持 720 宽度而不是 3840 宽度吗?这将使"只需运行" 并简化 Qt 等的 gstreamer 管道? 谢谢 -- 彼得 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory 您为 ADV7280 设置了什么格式,在管道中设置具体分辨率如何?例如,video/x-raw、width=720、height=480,看来问题与裁剪有关,您可以尝试设置分辨率并再次测试 Re: GstV4l2Src:v4l2src0: Failed to allocate required memory https://github.com/GStreamer/gst-plugins-good/blob/master/sys/v4l2/gstv4l2bufferpool.c#L668 if (obj->ioctl (pool->video_fd, VIDIOC_STREAMON, &obj->type) < 0) goto streamon_failed;
View full article