Using Emcraft OV5640 Camera
1. Emcraft OV5640 Camera
The i.MX 8MP NAVQ+ kit comes with support for connecting the Emcraft OV5640 camera. The OV5640 camera connects to the kit via the MIPI-CSI2 interface, and provides an easy way to bring visual input into the i.MX 8M Plus. The camera is based on the Omnivision OV5640 chip. It provides auto focus, focal length 2.8mm, range 60cm-infinity and an 66.7 degrees field-of-view. Link to the i.MX 8M Plus is via the dual-lane MIPI-CSI2 interface.
2. Connecting Emcraft OV5640 Camera
To connect the Emcraft OV5640 camera to the kit, plug the camera cable into the CSI2 on the back side of the carrier board. The following picture illustrates connection of the camera to the kit:
3. Software Setup
For correct functioning of the Emcraft OV5640 camera with NAVQ+ kit BSP release 1.1.7-387 or higher is required.
4. Finding Camera Device Nodes
Depending on additional hardware connected to the NAVQ+, the Emcraft OV5640 camera may not be the only V4L2 device present in the system. In order to access the camera the user needs to determine the correct video device file node.
The below command outputs video device node registered for single OV5640 camera connected to the NAVQ+:
user@imx8mpnavq:~$ v4l2-ctl --list-devices | grep -A1 mxc-isi-cap
mxc-isi-cap (platform:32e02000.isi:cap_devic):
/dev/video4
In the above output, the /dev/video4 device node corresponds to the camera connected to the CSI2 slot.
5. Streaming Video to HDMI Display
Use the “Cheese” program shipped as part of Gnome desktop environment for streaming video input from the OV5640 camera to the HDMI display connected to the NAVQ+:
user@imx8mpnavq:~$ cheese -d /dev/video4
At this point you should be getting GUI window with video stream displayed in real-time on your HDMI display:
6. Capturing Video Frames
Use the following Linux command to capture a single frame into a file:
user@imx8mpnavq:~$ gst-launch-1.0 v4l2src device='/dev/video4' num-buffers=1 ! jpegenc ! filesink location=capture1.jpeg
Use the following Linux command to capture a video stream into an h264 encoded file: