Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Rockpi4/hardware/camera/

< Rockpi4‎ | hardware
Revision as of 02:14, 2 March 2023 by Stephen (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
    ROCK Pi 4 >  Hardware >  Camera module

MIPI CSI Camera

ROCK Pi 4 supports The Raspberry Pi Camera Module v2 now. And Raspberry pi official camera module v1-OV5647 is in testing.

Test:

You must connect the display on ROCK Pi 4 before testing the camera module.

#!/bin/bash
#export GST_DEBUG=*:5
export DISPLAY=:0.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/aarch64-linux-gnu/gstreamer-1.0
#export GST_DEBUG=ispsrc:5
#export GST_DEBUG_FILE=/tmp/2.txt
echo "Start RKISP Camera Preview!"
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,format=NV12,width=1920,height=1080, framerate=30/1 ! xvimagesink

USB Camera

Update kernel to version 4.4.154-115-rockchip or newer.

root@rockpi4:~# apt install linux-4.4-rock-pi-4-latest

Install tool fswebcam

root@rockpi4:~# apt-get install -y fswebcam

Plug USB camera in, there shall be video devices.

root@rockpi4:~# ls /dev/video*
/dev/video4  /dev/video5

Capture image

fswebcam -d /dev/video4 ./test.png

Troubleshooting