imx335的sh脚本不能修改viewmode,
-
imx335的sh脚本不能修改viewmode,在python或者cpp中使用videodev2.h头文件和v4l2来设置摄像头,并ioctl的VIDIOC_G_FMT获取height和width时候,发现会变成2592x1944.
-
@veyeuser
VEYE-MIPI-IMX335由于具有一个isp模块,支持的分辨率只有几种模式。
可以使用veye5_mipi_i2c.sh直接配置,或者像下面链接中的,使用sensor_mode配置。
https://wiki.veye.cc/index.php/VEYE_CS_Camera_for_Jetson_TX2#VEYE-MIPI-IMX335_gstreamer_example -
我用脚本设置了view mode 4 ,但是通过如下代码获取摄像头的设置,发现设置右变回 view mode 1
//3. set form of acquisition
struct v4l2_format vfmt;
// vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
// vfmt.fmt.pix.width = 2592;
// vfmt.fmt.pix.height = 1944;
// vfmt.fmt.pix.field = V4L2_FIELD_ANY;
// vfmt.fmt.pix.pixelformat = V4L2_PIX_FMT_UYVY;
//
// int ret = ioctl(fd, VIDIOC_S_FMT, &vfmt);
// if(ret < 0){
// perror("set form fail!");
// }
//
memset(&vfmt, 0, sizeof(vfmt));
vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
ret = ioctl(fd, VIDIOC_G_FMT, &vfmt);
if(ret < 0){
perror("get form fail!");
}printf("width = %d\n", vfmt.fmt.pix.width); printf("height = %d\n", vfmt.fmt.pix.height); unsigned char *p = (unsigned char *)&vfmt.fmt.pix.pixelformat; printf("pixelformat=%c%c%c%c\n", p[0], p[1], p[2], p[3]);// printf("pixelformat = %d\n", vfmt.fmt.pix.pixelformat);
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