Welcome to RDK X5 Board repository
1.Camera image display
Camera image display
1. Environment preparation
This example vio2display implements the MIPI camera image acquisition function and outputs it through the HDMI interface. Users can preview the image through the display. The example flow chart is as follows:

- When the development board is powered off, connect the MIPI camera to the development board (with the black side facing the HDMI port).
- Connect the development board and the monitor via an HDMI cable
- Power on the development board and log in to the system
2. How to run
The sample code is provided in source code form. You need to use the make command to compile and run it. The steps are as follows.
xxxxxxxxxxsunrise@ubuntu:~$ cd /app/cdev_demo/vio2displaysunrise@ubuntu:/app/cdev_demo/vio2display$ sudo makesunrise@ubuntu:/app/cdev_demo/vio2display$ sudo ./vio2display -w 1920 -h 1080Parameter description:
- w: sensor output width
- h: sensor output height
3. Expected results
After the program runs correctly, the development board will output the real-time image captured by the MIPI camera through the display.
The running log is as follows.
x sunrise@ubuntu:/tmp/nfs/sp_cdev/cdev_demo/vio2display$ ./vio2display -w 1920 -h 1080 disp_w=1920, disp_h=1080 2023/03/28 02:08:03.359 !INFO [x3_cam_init_param][0099]Enable mipi host0 mclk 2023/03/28 02:08:03.359 !INFO [x3_cam_init_param][0099]Enable mipi host1 mclk Camera: gpio_num=114, active=low, i2c_bus=3, mipi_host=0 Camera: gpio_num=114, active=low, i2c_bus=1, mipi_host=1 Camera: gpio_num=114, active=low, i2c_bus=0, mipi_host=2 Camera 0: enable: 1 i2c_bus: 3 mipi_host: 0 Camera 1: enable: 1 i2c_bus: 1 mipi_host: 1 Camera 2: enable: 1 i2c_bus: 0 mipi_host: 2 cmd=i2ctransfer -y -f 3 w2@0x10 0x0 0x0 r1 2>&1, result=0x02
Found sensor:imx219 on i2c bus 3, use mipi host 0 Setting VPS channel-2: src_w:1920, src_h:1080; dst_w:1920, dst_h:1080; Setting VPS channel-1: src_w:1920, src_h:1080; dst_w:1920, dst_h:1080; sp_open_camera success! libiar: hb_disp_set_timing done!
Press 'q' to Exit !