Displaying Camera Images using GStreamer
Using MIPI Camera
These instructions are for using a OV5645 MIPI Camera and MIPI Adapter Mezzanine board.
Before GStreamer can be used, the VIN/CSI settings must best configured manually on the command line using the media-ctl utility.
In the BSP, this is done by running the script /home/root/vin-init.sh in the rootfs.
This file located in the BSP at rzg2_bsp_eva_v104/meta-rzg2/recipes-multimedia/vin-init/files/vin-init.sh
The BSP also installs the file systemd service file "vin.service" into /etc/systemd/system/multi-user.target.wants/vin.service so that the vin-init.sh script runs automatically on system boot.
For example, for RZ/G2E,the follow command will be executed:
media-ctl -d /dev/media0 -r
media-ctl -d /dev/media0 -l "'rcar_csi2 feaa0000.csi2':1 -> 'VIN4 output':0 [1]"
media-ctl -d /dev/media0 -V "'rcar_csi2 feaa0000.csi2':1 [fmt:UYVY8_2X8/1280x960 field:none]"
media-ctl -d /dev/media0 -V "'ov5645 3-003c':0 [fmt:UYVY8_2X8/1280x960 field:none]"
This connects VIN4 (/dev/video0) to OV5645.
The only thing you can change in G2E is 'VIN4 output' => 'VIN5 output' if you want to use /dev/video1
For more information, please refer to the document R01US0400EJ0107_GStreamer_UME_v1.0x.pdf that comes the RZG2 Group BSP Manual Set that can be downloaded from renesas.com
For the RZ/G2L and RZ/V2L, the settings are slightly different because the device name is rzg2l_csi2. Supported resolutions are 1280x960, 1920x1080, 2592x1944.
media-ctl -d /dev/media0 -r
media-ctl -d /dev/media0 -l "'rzg2l_csi2 10830400.csi2':1 -> 'CRU output':0 [1]"
media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/1920x1080 field:none]"
media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/1920x1080 field:none]"
Using USB Camera
These instructions are useful to check if USB camera is working or not with RZ/G2 board.
1. Check whether UVC driver is enabled or not. If there is no output, UVC driver is not enabled.
root@hihope-rzg2m:~# zcat /proc/config.gz | grep USB_VIDEO
CONFIG_USB_VIDEO_CLASS=y
CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y
root@hihope-rzg2m:~# dmesg | grep uvcvideo
[ 1.977174] usbcore: registered new interface driver uvcvideo
[ 3.070300] uvcvideo: Found UVC 1.00 device HD Pro Webcam C920 (046d:0892)
2. Check camera device number
root@hihope-rzg2m:~# v4l2-ctl --list-devices
fe960000.vsp rpf.0 input (platform:fe960000.vsp):
/dev/video2
/dev/video3
/dev/video4
/dev/video5
/dev/video6
/dev/video7
fe9a0000.vsp rpf.0 input (platform:fe9a0000.vsp):
/dev/video8
/dev/video9
HD Pro Webcam C920 (usb-ee000000.usb-1):
/dev/video0
3. List supported video formats and resolutions of a specific video device:
# v4l2-ctl --list-formats-ext --device /dev/video1
4. Run
root@hihope-rzg2m:~# modprobe uvcvideo # to enable USB camera driver
root@hihope-rzg2m:~# gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! waylandsink
AISTARVISION 96BOARDS MIPI Adapter v2.4
Top view of AISTARVISION 96Boards MIPI Adapter version 2.4
| OV5645 MIPI
| Connection OV5645 camera to adapter board
|
Connection guide for Silicon Linux RZ/G2E evaluation kit (EK874)
To connect and use CSI40 with OV5645:
1. Connect 20th pin to 19th pin on J13 header for I2C SCL line.
2. Connect 22nd pin to 21st pin on J13 header for I2C SDA line.
3. Connect 23rd pin to 6th pin on J15 header for supplying power to OV5645 camera sensor.
4. Connect 6th pin to 5th pin and 4th pin to 3rd pin on J14 header for supplying clock to OV5645 camera sensor.
5. Connect OV5645 camera sensor to J3 header for CSI40 Interface
Instruction of connecting OV5645 camera module in EK874
| Connection of adpater board and G2E
|
To connect and use CSI20 with OV5645:
1. Connect 15th pin to 16th pin on J13 header for I2C SCL line.
2. Connect 17th pin to 18th pin on J13 header for I2C SDA line.
3. Connect 24th pin to 14th pin on J15 header for supplying power to OV5645 camera sensor.
4. Connect 6th pin to 5th pin and 4th pin to 3rd pin on J14 header for supplying clock to OV5645 camera sensor.
5. Connect OV5645 camera sensor to J4 header. It uses for linking OV5645 with CSI20 Interface.
Instruction of connecting OV5645 camera module in RZG2M
| |
MIPI Virtual Channels