Navigation

    VEYE IMAGING Forum

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Recent
    • Popular
    • Users
    • WIKI
    • veye.cc

    UNSOLVED imx335的sh脚本不能修改viewmode,

    CS MIPI camera
    2
    3
    437
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      veyeuser last edited by

      imx335的sh脚本不能修改viewmode,在python或者cpp中使用videodev2.h头文件和v4l2来设置摄像头,并ioctl的VIDIOC_G_FMT获取height和width时候,发现会变成2592x1944.

      veye_xumm 1 Reply Last reply Reply Quote 0
      • veye_xumm
        veye_xumm @veyeuser last edited by

        @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

        1 Reply Last reply Reply Quote 0
        • V
          veyeuser last edited by

          我用脚本设置了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);

          1 Reply Last reply Reply Quote 0
          • First post
            Last post