Welcome to RDK X5 MagicBox repository
2. Camera Image Local Saving
Local save camera images
1. Experimental preparation
This example vio_capture implements the function of capturing images from MIPI cameras and saving images in two formats, RAW and YUV, locally.
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 interface).
- 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/vio_capture/sunrise@ubuntu:/app/cdev_demo/vio_capture$ sudo makesunrise@ubuntu:/app/cdev_demo/vio_capture$ sudo ./capture -b 12 -c 10 -h 1080 -w 1920参数说明:
Parameter description:
- -b: RAW image bit number, IMX219 / IMX477 / OV5647 are all set to 16, only a few camera sensors need to be set to 8
- -c: Number of saved images
- -w: Width of saved images
- -h: Height of saved images
3. Expected results
After the program runs correctly, the current directory will save the specified number of image files.
The RAW format is named in the raw_*.raw format, and the YUV format is named in the yuv_*.yuv format.
The running log is as follows.
sunrise@ubuntu:/app/cdev_demo/vio_capture$ sudo ./capture -b 12 -c 10 -h 1080 -w 1920Setting 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;jiale:start streaming...capture time :0capture time :1capture time :2capture time :3capture time :4capture time :5capture time :6capture time :7capture time :8capture time :9sensor_name imx477, setting_size = 1[ 701.213210]hb_isp_algo_stop@main_user.c:389 GENERIC(ERR) :g_mutex destroy.