"Device Drivers -> Multimedia support -> Sensors used on soc_camera driver"
"Device Drivers -> Multimedia support -> Media Controller API"
"Device Drivers -> Multimedia support -> V4L2 sub-device userspace API"
"Device Drivers -> Multimedia support -> Autoselect ancillary drivers (tuners, sensors, i2c, frontends)"
"Device Drivers -> Multimedia support -> Encoders, decoders, sensors and other helper chips"
arch/arm/boot/dts/at91sam9x5ek.dtsi
to add the new sensor's i2c information and configure the pin mux.
"Package Selection for the target -> Graphic libraries and applications -> fswebcam"
.
#!/bin/sh VIDEO_DEV=/dev/video0 SKIP_FRAMES=20 # test preview channel fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p RGB565 -r 640x480 rgb565.jpg fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p RGB565 -r 320x240 rgb565_defactor.jpg # test codec channel fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p YUYV -r 640x480 yuyv.jpg fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p YUYV -r 800x600 yuyv_800x600.jpg fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p UYVY -r 640x480 uyvy.jpg fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p UYVY -r 800x600 uyvy_800x600.jpg # test codec channel, without any processing, GREY, or Bayer RGB. fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p BAYER -r 640x480 bayer_bggr8.jpg fswebcam -S ${SKIP_FRAMES} -d ${VIDEO_DEV} -p SGRBG8 -r 640x480 bayer_grbg8.jpg
-S
: frames that need to skip.
-d /dev/video0
: specify the ISI as the input source.
-p
: pixel format, can be RGB565, YUYV, UYVY, BAYER, SGRBGB8 and etc.
-r
: resolution.
"Package Selection for the target -> Audio and video applications -> ffmpeg"
.
ffmpeg -r 25 -s vga -t 20 -pix_fmt yuyv422 -f video4linux2 -i /dev/video0 video.avi
-r
: frame rate
-s
: resolution, it can be qcif, cif, qvga, vga, svga, xga, uxga
.
-t
: time duration in second.
-pix_fmt
: pixel format, only support yuyv422.
-f video4linux2
: specify the format. Use ffmpeg -formats
will show all supported formats.
-i /dev/video0
: specify the ISI as the input source. Run following command to check the source name: # cat /sys/class/video4linux/video0/name isi-camera
video.avi
: output video file name
vcodec
specified, it use mpeg4
as default.
Tips: Run ffmpeg -pix_fmts
can show all the supported pixel formats.
ffmpeg -f video4linux2 -r 1 -s vga -t 4 -i /dev/video0 -pix_fmt yuyv422 -f image2 -vcodec png image%d.png
-r
: frame rate
-s
: resolution, it can be qcif, cif, qvga, vga, svga, xga, uxga
.
-t
: time duration in second.
-i /dev/video0
: specify the ISI as the input source. Run following command to check the source name: # cat /sys/class/video4linux/video0/name isi-camera
-pix_fmt
: pixel format, only support yuyv422.
-f image2
: image2 sequence format. Use ffmpeg -formats
will show all supported formats.
-vcodec png
: specify output format is png. Use ffmpeg -codecs
will show all supported codec.
image%d.png
: output file name is image1.png, image2.png and etc.
"Package Selection for the target -> Audio and video applications -> gstreamer"
and the plugins that you needed.
# gstreamer 0.10 gst-launch v4l2src device="/dev/video1" ! video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! fbdevsink # gstreamer 1.0 gst-launch-1.0 v4l2src device="/dev/video1" ! video/x-raw,width=640,height=480 ! videoconvert ! fbdevsink
v4l2src
: a plugin to support v4l2 device as a source device="/dev/video1"
: specify the ISI as the v4l2 input device. cat /sys/class/video4linux/video1/name
video/x-raw-yuv,width=640,height=480
: For gstreamer 0.10, specify the v4l2 output video format and size.
video/x-raw,width=640,height=480
: For gstreamer 1.0, specify the v4l2 output video format and size.
ffmpegcolorspace
or videoconvert
: a plugin to convert from one color space to another
fbdevsink
: a plugin to render to framebuffer device
gst-inspect
will show all installed plugins.
Tips: run gst-inspect [plugin name]
will show all supported parameters for this plugins.
"Package Selection for the target -> Libraries -> Graphics -> zxing"
.
make zxing
to generate the barcode application: zxing_barcode
. zxing_barcode
is located on outpout/target/use/bin/
.
zxing_barcode *.jpg
arch/arm/boot/dts/sama5d3xek.dts
#include "sama5d3xmb_isi_sensors.dtsi"
i2c0: i2c@f0014000 { status = "disabled"; }; ... ... leds { d3 { label = "d3"; gpios = <&pioE 24 GPIO_ACTIVE_HIGH>; status = "disabled"; }; };
make dtbs # before doing this make sure your config is based on sama5_defconfig
soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0 ov2640 0-0030: ov2640 Product ID 26:42 Manufacturer ID 7f:a2 i2c i2c-0: OV2640 Probed soc-camera-pdrv soc-camera-pdrv.1: Probing soc-camera-pdrv.1 ov5642 0-003c: reg_read: i2c read error, reg: 300a ov5642: probe of 0-003c failed with error -121In above example, the message shows an OV2640 sensor is probed. But fail to probe of OV5642 as we only support one camera module slot in the board.
# ls /sys/class/video4linux/video* /sys/class/video4linux/video0: debug dev index name power subsystem uevent /sys/class/video4linux/video1: debug device name subsystem dev index power uevent # cat /sys/class/video4linux/video0/name # cat /sys/class/video4linux/video1/name isi-cameraIn above example, we can find the
video1
is the isi-camera
device.
.dts, .dtsi
): arch/arm/mach-at91/board-dt.c
file or .dts, .dtsi
(in linux-3.18 and later) files: WebFaqBaseForm | |
---|---|
Boards | Sama5d4Xplained, Sama5d4ek, Sama5d3Xplained, Sama5d3xek |
Components | Kernel, linux-3.18-at91, linux-4.1-at91, linux-4.4-at91, linux-4.9-at91 |
Summary | How to use the Image Sensor Interface |
|
|||||||||||||||||||||||||||||
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Microchip and others, are registered trademarks or trademarks of Microchip Technology Inc. and its subsidiaries.
Arm® and others are registered trademarks or trademarks of Arm Limited (or its affiliates). Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.