BPI-M2 Berry CSI camera

OS/Banana Pi 2017.08.31 23:42 Posted by 파란크리스마스

BPI-M2 Berry CSI camera Camera(OV5640)

출처 : BPI-M2+ OV5640 camera linux driver is work fine
BPI-M2+ camera module

Camera 모듈 설치

$ sudo vi /etc/modules

내용 추가

ov5640
vfe_v4l2

Camera 설치 확인

$ dmesg | grep ov5640
[    4.253186] [VFE]Find sensor name is "ov5640", i2c address is 78, type is "YUV" !
[    4.253197] [VFE]Sub device register "ov5640" i2c_addr = 0x78 start!
[    4.521666] [VFE]Sub device register "ov5640" is OK!
$ ls /dev/video*
/dev/video0

Camera 정보

$ modinfo ov5640
filename:       /lib/modules/3.10.107-BPI-M2U-Kernel/kernel/drivers/media/platform/sunxi-vfe/device/ov5640.ko
license:        GPL
description:    A low-level driver for ov5640 sensors
author:         raymonxiu
srcversion:     179C0D2FEBE682C736CFAEB
alias:          i2c:ov5640
depends:        vfe_io
intree:         Y
vermagic:       3.10.107-BPI-M2U-Kernel SMP mod_unload modversions ARMv7 p2v8 

Camera 캡쳐 프로그램 컴파일 및 실행

출처 : https://github.com/avafinger/ov5640

$ git clone https://github.com/avafinger/cap-v4l2
$ cd cap-v4l2
$ sudo ./install_deps.sh
$ ./build_script.sh

캡쳐

$ ./cap 1280 720 4 1 -999 -1 -1
---- cap parameters -----
width: 1280
height: 720
v4l2 buffers: 4
exposure: -999
hflip: -1
vflip: -1
Mode: V4L2_MODE_VIDEO
Driver: "sunxi-vfe"
Card: "sunxi-vfe"
Bus: "sunxi_vfe csi0"
Version: 1.0
Capabilities: 05000001
Input: 0
V4L2 pixel formats:
0: [0x50323234] '422P' (planar YUV 422)
1: [0x32315559] 'YU12' (planar YUV 420)
2: [0x32315659] 'YV12' (planar YVU 420)
3: [0x3631564E] 'NV16' (planar YUV 422 UV combined)
4: [0x3231564E] 'NV12' (planar YUV 420 UV combined)
5: [0x3136564E] 'NV61' (planar YUV 422 VU combined)
6: [0x3132564E] 'NV21' (planar YUV 420 VU combined)
7: [0x32314D48] 'HM12' (MB YUV420)
8: [0x56595559] 'YUYV' (YUV422 YUYV)
9: [0x55595659] 'YVYU' (YUV422 YVYU)
10: [0x59565955] 'UYVY' (YUV422 UYVY)
11: [0x59555956] 'VYUY' (YUV422 VYUY)
12: [0x31384142] 'BA81' (RAW Bayer BGGR 8bit)
13: [0x47524247] 'GBRG' (RAW Bayer GBRG 8bit)
14: [0x47425247] 'GRBG' (RAW Bayer GRBG 8bit)
15: [0x47425247] 'GRBG' (RAW Bayer RGGB 8bit)
16: [0x30314742] 'BG10' (RAW Bayer BGGR 10bit)
17: [0x30314247] 'GB10' (RAW Bayer GBRG 10bit)
18: [0x30314142] 'BA10' (RAW Bayer GRBG 10bit)
19: [0x30314142] 'BA10' (RAW Bayer RGGB 10bit)
20: [0x32314742] 'BG12' (RAW Bayer BGGR 12bit)
21: [0x32314247] 'GB12' (RAW Bayer GBRG 12bit)
22: [0x32314142] 'BA12' (RAW Bayer GRBG 12bit)
23: [0x32314142] 'BA12' (RAW Bayer RGGB 12bit)
V4L2 pixel sizes:
( 2592 x 1936 ) Pixels
( 2048 x 1536 ) Pixels
( 1920 x 1080 ) Pixels
( 1600 x 1200 ) Pixels
( 1280 x 960 ) Pixels
( 1280 x 720 ) Pixels
( 1024 x 768 ) Pixels
( 800 x 600 ) Pixels
( 640 x 480 ) Pixels

Sensor size: 1280x720 pixels
Pixel Format: V4L2_PIX_FMT_YUV420 [0x32315559]
Frame #10 will be saved!
Length: 1382400         Bytesused: 1382400      Address: 0x49528
FPS[0]: 11.87
Length: 1382400         Bytesused: 1382400      Address: 0x49530
FPS[1]: 30.19
Length: 1382400         Bytesused: 1382400      Address: 0x49538
FPS[2]: 30.16
Length: 1382400         Bytesused: 1382400      Address: 0x49540
FPS[3]: 30.78
Length: 1382400         Bytesused: 1382400      Address: 0x49528
FPS[4]: 30.20
Length: 1382400         Bytesused: 1382400      Address: 0x49530
FPS[5]: 30.18
Length: 1382400         Bytesused: 1382400      Address: 0x49538
FPS[6]: 30.09
Length: 1382400         Bytesused: 1382400      Address: 0x49540
FPS[7]: 30.07
Length: 1382400         Bytesused: 1382400      Address: 0x49528
FPS[8]: 29.85
Length: 1382400         Bytesused: 1382400      Address: 0x49530
FPS[9]: 5.85
------- Avg FPS: 30.19 --------


 

티스토리 툴바