Difference between revisions of "MV Camera Application Development Guide on Rochchip"

From wiki_veye
Jump to navigation Jump to search
Line 3: Line 3:
 
Application Layer Usage and Development Guide for MV/RAW Series Camera Modules on the Rockchip Platform
 
Application Layer Usage and Development Guide for MV/RAW Series Camera Modules on the Rockchip Platform
  
=== Overview ===
+
===Overview===
 
This document applies to scenarios where the camera hardware is correctly connected, the driver is properly installed, and the MV/RAW series camera has been successfully recognized.
 
This document applies to scenarios where the camera hardware is correctly connected, the driver is properly installed, and the MV/RAW series camera has been successfully recognized.
  
 
The main objectives of this guide are to:
 
The main objectives of this guide are to:
  
* Query the device information of the connected MV/RAW series camera
+
*Query the device information of the connected MV/RAW series camera
* Configure and prepare the camera operating modes
+
*Configure and prepare the camera operating modes
* Introduce several methods for previewing and capturing images
+
*Introduce several methods for previewing and capturing images
* Explain camera parameter configuration
+
*Explain camera parameter configuration
* Provide guidance for customer-specific development
+
*Provide guidance for customer-specific development
  
 
On the Rockchip platform, regardless of the method used to access the camera, it is necessary to complete '''device detection''' and '''media-ctl configuration''' before performing any further operations. Therefore, the following sections first cover device detection and media-ctl setup.
 
On the Rockchip platform, regardless of the method used to access the camera, it is necessary to complete '''device detection''' and '''media-ctl configuration''' before performing any further operations. Therefore, the following sections first cover device detection and media-ctl setup.
 +
 +
=== Device Detection and Environment Configuration ===
 +
[https://github.com/veyeimaging/rk35xx_veye_bsp/tree/main/mv_tools_rockchip/i2c_tools Here], we provide two scripts that can automatically retrieve key information about the connected camera.
 +
 +
==== probe_camera_info-rk.sh ====
 +
This script is used to probe connected and successfully registered camera devices, retrieving underlying information such as the corresponding media device node, video device node, sub-device node, I²C bus, and device name.
 +
 +
After execution, an <code>auto_camera_index.json</code> file will be generated in the current directory, containing the retrieved information.
 +
 +
Example usage:
 +
 +
<code>$ ./probe_camera_info-rk.sh</code>
 +
 +
<code>cat auto_camera_index.json</code>
 +
 +
<code>[</code>
 +
 +
<code>  {</code>
 +
 +
<code>    "media_node": "/dev/media0",</code>
 +
 +
<code>    "video_node": "/dev/video0",</code>
 +
 +
<code>    "video_subnode": "/dev/v4l-subdev2",</code>
 +
 +
<code>    "media_entity_name": "m00_b_mvcam 7-003b",</code>
 +
 +
<code>    "i2c_bus": "7"</code>
 +
 +
<code>  }</code>
 +
 +
<code>]</code>
 +
 +
Each <code>{}</code> block represents a single camera. If the board supports multiple camera modules, multiple <code>{}</code> blocks will be present in the file.
 +
 +
Explanation of Camera Information:
 +
<br />
 +
{| class="wikitable"
 +
|+Camera Information
 +
!Field
 +
!Name
 +
!Purpose
 +
!Usage
 +
|-
 +
|media_node
 +
|Media device node
 +
|Used to access the device within the media-controller framework
 +
|Used when configuring resolution and format via the <code>media-ctl</code> command
 +
|-
 +
|video_node
 +
|Video capture device node
 +
|Standard V4L2 video device
 +
|Used with <code>v4l2-ctl</code> or customer applications to capture images
 +
|-
 +
|video_subnode
 +
|V4L2 sub-device node
 +
|Used for configuring certain camera parameters
 +
|Accessed via <code>v4l2-ctl</code> commands
 +
|-
 +
|media_entity_name
 +
|Media entity name
 +
|Describes the device, e.g., <code>"m00_b_mvcam 7-003b"</code>
 +
|Used when setting resolution and format with <code>media-ctl</code>
 +
|-
 +
|i2c_bus
 +
|I²C bus
 +
|Indicates the I²C bus to which the device is connected
 +
|Used as the underlying communication channel for camera parameter configuration, e.g., by the <code>mv_mipi_i2c.sh</code> script
 +
|}

Revision as of 10:59, 26 December 2025

查看中文

Application Layer Usage and Development Guide for MV/RAW Series Camera Modules on the Rockchip Platform

1 Overview

This document applies to scenarios where the camera hardware is correctly connected, the driver is properly installed, and the MV/RAW series camera has been successfully recognized.

The main objectives of this guide are to:

  • Query the device information of the connected MV/RAW series camera
  • Configure and prepare the camera operating modes
  • Introduce several methods for previewing and capturing images
  • Explain camera parameter configuration
  • Provide guidance for customer-specific development

On the Rockchip platform, regardless of the method used to access the camera, it is necessary to complete device detection and media-ctl configuration before performing any further operations. Therefore, the following sections first cover device detection and media-ctl setup.

2 Device Detection and Environment Configuration

Here, we provide two scripts that can automatically retrieve key information about the connected camera.

2.1 probe_camera_info-rk.sh

This script is used to probe connected and successfully registered camera devices, retrieving underlying information such as the corresponding media device node, video device node, sub-device node, I²C bus, and device name.

After execution, an auto_camera_index.json file will be generated in the current directory, containing the retrieved information.

Example usage:

$ ./probe_camera_info-rk.sh

cat auto_camera_index.json

[

  {

    "media_node": "/dev/media0",

    "video_node": "/dev/video0",

    "video_subnode": "/dev/v4l-subdev2",

    "media_entity_name": "m00_b_mvcam 7-003b",

    "i2c_bus": "7"

  }

]

Each {} block represents a single camera. If the board supports multiple camera modules, multiple {} blocks will be present in the file.

Explanation of Camera Information:

Camera Information
Field Name Purpose Usage
media_node Media device node Used to access the device within the media-controller framework Used when configuring resolution and format via the media-ctl command
video_node Video capture device node Standard V4L2 video device Used with v4l2-ctl or customer applications to capture images
video_subnode V4L2 sub-device node Used for configuring certain camera parameters Accessed via v4l2-ctl commands
media_entity_name Media entity name Describes the device, e.g., "m00_b_mvcam 7-003b" Used when setting resolution and format with media-ctl
i2c_bus I²C bus Indicates the I²C bus to which the device is connected Used as the underlying communication channel for camera parameter configuration, e.g., by the mv_mipi_i2c.sh script