移植MV-IMX265驱动程序到迅为RK3568抓图卡死
-
@w88121446 调用的时候参数是怎么写的? i2cbus写对了吗?
-
@veye_xumm
我是这么写的,我的I2C用的I2C2,产品分辨率2048*1544import sys import argparse import subprocess import cv2 def read_cam(width, height, fps,i2c): v4l2_cmd = f'media-ctl -d /dev/media0 --set-v4l2 \'"m00_b_mvcam {i2c}-003b":0[fmt:Y8_1X8/{width}x{height}@1/{fps} field:none]\'' subprocess.run(v4l2_cmd, shell=True) cap = cv2.VideoCapture(f"v4l2src io-mode=dmabuf device=/dev/video0 ! video/x-raw, format=(string)GRAY8, width=(int){width}, height=(int){height} ! appsink") if cap.isOpened(): cv2.namedWindow("demo", cv2.WINDOW_AUTOSIZE) while True: ret_val, img = cap.read(); cv2.imshow('demo',img) cv2.waitKey(1) else: print ("camera open failed"); cv2.destroyAllWindows() if __name__ == '__main__': parser = argparse.ArgumentParser(description='Read camera video stream') parser.add_argument('--width', type=int, default=2048, help='width of the video stream') parser.add_argument('--height', type=int, default=1544, help='height of the video stream') parser.add_argument('--fps', type=int, default=30, help='fps of the video stream') parser.add_argument('--i2c', type=int, default=2, help='i2c bus number') args = parser.parse_args() read_cam(args.width, args.height, args.fps, args.i2c) -
@w88121446 不好意思我没有说清楚,我的意思是,你调用这个脚本的时候,使用的命令行是什么?参数是什么?
-
@veye_xumm这样调用的
python3 v4l2dev_2_opencv_show_grey.py
-
@w88121446
需要给一下必要的参数python3 ./v4l2dev_2_opencv_show_grey.py --width 2048 --height 1544 --fps 45 --i2c 2 -
@veye_xumm 我使用您发给我的命令还是不能打开caramer,再次确认了是I2C-2没有错

-
-
@veye_xumm 可以使用下面这个命令拍照,图片正常
./yavta -c1 -Fy81-2048x1544.raw --skip 0 -f Y8 -s 2048x1544 /dev/video0 -
@w88121446
如果是这样,驱动层是没有问题的。
怀疑是使用 OpenCV 的 GStreamer 管道时,确保正确安装和配置了 GStreamer:
在某些系统上,GStreamer 可能没有正确配置,导致 OpenCV 无法通过 GStreamer 打开视频设备。gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=GRAY8,width=2048,height=1544 ! autovideosink -
@veye_xumm said in 移植MV-IMX265驱动程序到迅为RK3568抓图卡死:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=GRAY8,width=2048,height=1544 ! autovideosink
用您发的这个命令的话,我要把format=GRAY8改成format=NV12才能预览。
关于GStreamer 可能没有正确配置,导致 OpenCV 无法通过 GStreamer 打开视频设备。这个事情,我就查一查GStreamer的配置问题是吧!
-
@w88121446 我们用的firefly的板子,gstreamer是支持gray8数据格式的。
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login