无法使用命令 `v4l2-ctl --device /dev/video0 --all` 获取所有详细信息 大家好, 我正在使用相机传感器os02g10。我可以从传感器获取 RAW10 文件,但是图像不正确。图片错位了,两部分图像错位了。您可以在这里看到: https://community.nxp.com/t5/i-MX-Processors/Camera-sensor-os02g10-MIPI-CSI-for-IMX8MM-Image-issue/m-p/1512386#M194329 我测试了摄像头传感器和 mipi-csi 的许多设备树设置,但图像没有任何变化。 v4l2也存在问题,您可以在下方看到。为什么它无法获得 Driver Info:
Driver name : mx6s-csi
Card type : i.MX6S_CSI
Bus info : platform:32e20000.csi_bridge
Driver version : 5.10.72
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 0
Video input : 0 (Camera: ok)
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : ''
Field : None
Bytes per Line : 0
Size Image : 4147200
Colorspace : Default
Transfer Function : Default (maps to Rec. 709)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 0, Height 0
Default : Left 0, Top 0, Width 0, Height 0
Pixel Aspect: 1/1
Selection Video Capture: crop, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: crop_default, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose_default, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose_bounds, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose_padded, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: native_size, Left 0, Top 0, Width 0, Height 0, Flags: 但是当我拿到图片时,会发现更多细节。我试图确定 v4l2 是否是导致图片错误的原因,还是其他原因。到底出了什么问题? v4l2-ctl -d /dev/video0 --verbose --set-fmt-video=width=1920,height=1080,pixelformat=BG10 --stream-mmap --stream-count=1 --stream-to=bb001.raw
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : 'BG10' (10-bit Bayer BGBG/GRGR)
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: ITU-R 601
Quantization : Full Range
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 4147200 ts: 46.903731 delta: 46903.731 ms (ts-monotonic, ts-src-eof) i.MX 8M | i.MX 8M Mini | i.MX 8M Nano Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 您好,您可以使用我们已向上游提交的 Linux 驱动程序。 我们已在基于 i.mx8mp 的 debix 平台上进行了测试。 这是我们的司机。 https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=263d0fa1d46ac1ae2eebc5a5490fec58233c69ad 这是我们的DT https://web.git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a4d0f0c88ae8185315afbc1eb68c978ed710f759 -- 鲁特维 SiliconSignals Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all mx6s_vidioc_g_fmt_vid_cap 似乎不完整。 mx6s_vidioc_s_fmt_vid_cap 包含所有详细信息 btarnowski_0-1672393812102.pngbtarnowski_0-1672393812102.png Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 关于 RAW10,有解决方案。 https://community.nxp.com/t5/i-MX-Graphics/gst-launch-1-0-returns-Internal-data-stream-error/m-p/1536966 关于:v4l2-ctl --设备 /dev/video0 --all 很难说哪里出了问题,可能是摄像头驱动程序对 V4L2 使用了 ctrl API 而不是 ctrlio。 但现在这不是问题了,接下来我要设置的参数是曝光或增益。 Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 嗨@btarnowski 对于使用 v4l2-ctl --all 显示的问题,你只需要编辑 mx6s_capture.c 文件即可。在函数“mx6s_vidioc_s_fmt_vid_cap”中:只需复制整个 pix 结构体,而不是仅复制宽度/高度/图像大小/字段。 csi_dev->pix = f->fmt.pix; 这样,内部结构体 csi_dev->pix 就包含了执行 get_format 时所需的所有信息(参见函数 mx6s_vidioc_g_fmt_vid_cap)。 我觉得 mx6s_capture.c 有很多小错误,需要进行很多改进才能更好地与 v4l2 工具兼容。 此致问候 Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 你好, 使用v4l2-ctl --设备 /dev/video0 --all和gstream均未取得进展。 看起来像是摄像头传感器驱动程序的问题。 dev/media0 - 不需要 处理相机传感器有多种不同的方法。 下面您可以看到底层 API 处理方面的差异。 ov5640(摄像头传感器)在其他设备上可以正常工作。 btarnowski_0-1663928001102.pngbtarnowski_0-1663928001102.png 还有另一项比较: btarnowski_1-1663928150167.pngbtarnowski_1-1663928150167.png Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 你找到解决办法了吗?因为我也遇到了同样的错误,如果你也遇到了,请分享一下你的解决方法。 Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 而且我发现有些作业分配不正确。csi_bridge 应该分配给 media0。 btarnowski_0-1662374734790.pngbtarnowski_0-1662374734790.png 具体该怎么做?求助! Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 同时: root@qrnd:~# gst-inspect-1.0 -a > gst-inspect.txt 结果如下(见附件) Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 下一个问题:我可以看到视频设备,但是没有 /dev/media 设备。 root@qrnd:~# v4l2-ctl --list-devices
i.MX6S_CSI (platform:32e20000.csi_bridge):
/dev/video0
vsi_v4l2dec (platform:vsi_v4l2dec):
/dev/video2
vsi_v4l2enc (platform:vsi_v4l2enc):
/dev/video1 Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 我需要更新 Yocto 版本所需的软件包列表: # 相机支持工具 IMAGE_INSTALL_append = " i2c-tools" IMAGE_INSTALL_append = " v4l-utils" IMAGE_INSTALL_append = " gstreamer1.0" IMAGE_INSTALL_append = " gstreamer1.0-plugins-good" IMAGE_INSTALL_append = " gstreamer1.0-plugins-imx" IMAGE_INSTALL_append = " gstreamer1.0-plugins-base" IMAGE_INSTALL_append = " gst-player" IMAGE_INSTALL_append = " gstreamer1.0-meta-base" IMAGE_INSTALL_append = " gst-examples" IMAGE_INSTALL_append = " gstreamer1.0-rtsp-server" IMAGE_INSTALL_append = " gst1.0-fsl-plugin" IMAGE_INSTALL_append = " gstreamer1.0-plugins-good-video4linux2" IMAGE_INSTALL_append = " gstreamer1.0-plugins-good-png" IMAGE_INSTALL_append = "gstreamer1.0-plugins-good-jpeg" 但我现在在使用命令时遇到了问题。 gst -发布- 1.0v4l2src 设备 = / dev / video0 缓冲区 数量 = 1 !video / x - raw , width = 1920 , height = 1080 !pngenc !filesink location = / tmp / test_1920x1080.png 我得到的是: 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: Internal data stream error.
Additional debug info:
../git/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.057218529
Setting pipeline to NULL ...
Freeing pipeline ... Re: can not get all details with command: v4l2-ctl --device /dev/video0 --all 看来是 Yocto 造成了这个问题。内核镜像中并不包含所有必需的元器件。gstreamer-plugins-good缺少 v4lsrc。我向 Yocto 构建中添加了额外的软件包,但没有效果。需要调查 Yocto 版本过程的部署阶段。
記事全体を表示