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

Difference between revisions of "Rockpi4/hardware/camera/"

 
(One intermediate revision by one other user not shown)
Line 11: Line 11:
  
 
You must connect the display on ROCK Pi 4 before testing the camera module.
 
You must connect the display on ROCK Pi 4 before testing the camera module.
    test_camera-rkisp1.sh
+
 
 +
<pre>
 +
#!/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
 +
</pre>
  
 
=== USB Camera ===
 
=== 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 ===
 
=== Troubleshooting ===
  
 
* Post your issue on the forum: https://forum.radxa.com/c/rockpi4
 
* Post your issue on the forum: https://forum.radxa.com/c/rockpi4

Latest revision as of 02:14, 2 March 2023

    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