avafinger / cap-v4l2

capture frames from CMOS camera ov5640 / ov8865 using V4l2 and OpenCV
19 stars 20 forks source link

edit for opencv4, but not working. #6

Closed karu2003 closed 1 year ago

karu2003 commented 1 year ago

pi@bpim2z:~/src/cap-v4l2$ ./build_script.sh Building cap with local header.... cap.c: In function ‘int v4l2_display_pix_format(int)’: cap.c:208:1: warning: no return statement in function returning non-void [-Wreturn-type] 208 | } | ^ cap.c: In function ‘int v4l2_close_camera(int, int)’: cap.c:503:1: warning: control reaches end of non-void function [-Wreturn-type] 503 | } | ^ done!

run: ./cap 1280 768 4 1 -999 -1 -1

pi@bpim2z:~/src/cap-v4l2$ ./cap 1280 768 4 1 -999 -1 -1 ---- cap parameters ----- width: 1280 height: 768 v4l2 buffers: 4 exposure: -999 hflip: -1 vflip: -1 Mode: V4L2_MODE_VIDEO Driver: "sun6i-csi" Card: "sun6i-csi-capture" Bus: "platform:1cb0000.camera" Version: 1.0 Capabilities: a4200001 Input: 0 v4l2: unable to set stream parm. v4l2: failed to init camera.

pi@bpim2z:~/src/cap-v4l2$ uname -a Linux bpim2z 6.2.2-sunxi #2 SMP Fri Mar 3 10:56:18 UTC 2023 armv7l GNU/Linux

pi@bpim2z:~/src/cap-v4l2$ sudo lsmod [sudo] Passwort für pi: Module Size Used by sunrpc 339968 1 brcmfmac_wcc 16384 0 lz4hc 16384 0 lz4 16384 0 hci_uart 65536 0 sun4i_gpadc_iio 16384 0 btrtl 24576 1 hci_uart sun9i_hdmi_audio 16384 0 btbcm 16384 1 hci_uart industrialio 61440 1 sun4i_gpadc_iio bluetooth 540672 4 btrtl,hci_uart,btbcm snd_soc_hdmi_codec 20480 1 ecdh_generic 16384 1 bluetooth sun8i_thermal 16384 0 ecc 28672 1 ecdh_generic brcmfmac 196608 1 brcmfmac_wcc brcmutil 16384 1 brcmfmac cfg80211 565248 1 brcmfmac zram 24576 3 rfkill 20480 5 bluetooth,cfg80211 sunxi_cedrus 40960 0 binfmt_misc 20480 1 v4l2_mem2mem 20480 1 sunxi_cedrus joydev 24576 0 cpufreq_dt 20480 0 input_leds 16384 0 evdev 20480 4 uio_pdrv_genirq 20480 0 uio 20480 1 uio_pdrv_genirq ov5640 36864 1 sun6i_csi 28672 0 videobuf2_dma_contig 20480 2 sunxi_cedrus,sun6i_csi v4l2_fwnode 24576 2 ov5640,sun6i_csi v4l2_async 20480 3 ov5640,v4l2_fwnode,sun6i_csi videobuf2_memops 20480 1 videobuf2_dma_contig videobuf2_v4l2 20480 3 sunxi_cedrus,sun6i_csi,v4l2_mem2mem videobuf2_common 45056 6 sunxi_cedrus,videobuf2_dma_contig,sun6i_csi,videobuf2_memops,v4l2_mem2mem,videobuf2_v4l2 dm_mod 98304 0 ip_tables 24576 0 x_tables 28672 1 ip_tables autofs4 36864 2 lima 49152 0 pwrseq_simple 16384 1 gpu_sched 28672 1 lima drm_shmem_helper 16384 1 lima dw_hdmi_i2s_audio 16384 0 dw_hdmi_cec 16384 0 sunxi 16384 0 phy_generic 20480 2 sunxi display_connector 20480 0 gpio_keys 20480 0

pi@bpim2z:~/src/cap-v4l2$ v4l2-ctl --list-devices sun6i-csi-capture (platform:1cb0000.camera): /dev/video0 /dev/media0

cedrus (platform:cedrus): /dev/video1 /dev/media1

pi@bpim2z:~/src/cap-v4l2$ media-ctl --device /dev/media0 -p Media controller API version 6.2.2

Media device information

driver sun6i-csi model Allwinner A31 CSI Device serial bus info platform:1cb0000.camera hw revision 0x0 driver version 6.2.2

Device topology