---
# System prepended metadata

title: Raspberry pi CSI相機測試

---

Raspberry pi CSI相機測試
===

1. 確認韌體版本:
```bash=
root@raspberrypi4:~# vcgencmd version
Apr 30 2021 15:55:03 
Copyright (c) 2012 Broadcom
version 3e104c5ed69dc796755b7195973a8d00482d76dd (clean) (release) (start_x)
```

2. 確認是否有偵測到相機:
detected為1表示有偵測到
```bash=
root@raspberrypi4:~# vcgencmd get_camera
supported=1 detected=1
```

3. 確認相機支援格式:
```bash=
root@raspberrypi4:~# v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'YU12' (Planar YUV 4:2:0)
        [1]: 'YUYV' (YUYV 4:2:2)
        [2]: 'RGB3' (24-bit RGB 8-8-8)
        [3]: 'JPEG' (JFIF JPEG, compressed)
        [4]: 'H264' (H.264, compressed)
        [5]: 'MJPG' (Motion-JPEG, compressed)
        [6]: 'YVYU' (YVYU 4:2:2)
        [7]: 'VYUY' (VYUY 4:2:2)
        [8]: 'UYVY' (UYVY 4:2:2)
        [9]: 'NV12' (Y/CbCr 4:2:0)
        [10]: 'BGR3' (24-bit BGR 8-8-8)
        [11]: 'YV12' (Planar YVU 4:2:0)
        [12]: 'NV21' (Y/CrCb 4:2:0)
        [13]: 'RX24' (32-bit XBGR 8-8-8-8)

```

4. 測試拍照:
輸出圖片cam.jpg
```bash=
raspistill -o cam.jpg
```