Community
cancel
Showing results for 
Search instead for 
Did you mean: 
HLin35
Beginner
1,959 Views

VIDEOIO ERROR: V4L: index 45 is not correct!

Hi, did anyone managed to get the usb camera working in Python? When I run the following code, error happend.

import cv2

cap=cv2.VideoCapture(45)

VIDEOIO ERROR: V4L: index 45 is not correct!

[ 3080.391709] ------------[ cut here ]------------

[ 3080.396938] WARNING: CPU: 2 PID: 2603 at /var/lib/jenkins/jobs/release-builder-refos/workspace/build/tmp-glibc/work-shared/intel-5xx-64/kernel-source/drivers/media/v4l2-core/v4l2-ioctl.c:1348 v4l_enum_fmt+0xf4a/0x12c0 [videodev]

[ 3080.419581] Unknown pixelformat 0x45454270

[ 3080.424162] Modules linked in: snd_usb_audio snd_usbmidi_lib snd_hwdep snd_rawmidi uvcvideo snd_seq_device videobuf2_vmalloc 8021q iptable_nat nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv6 nf_conntrack_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 xt_conntrack nf_conntrack asix usbnet libphy intel_ipu4_isys_mod_bxtB0(O) videobuf2_v4l2 videobuf2_core intel_ipu4_psys_mod_bxtB0(O) intel_ipu4_mmu_bxtB0(O) intel_ipu4_mod_bxtB0(O) iova intel_ipu4_acpi(O) videobuf2_dma_contig videobuf2_memops videobuf_core dw9714(O) crlmodule(O) v4l2_common videodev media usb_f_mtp usb_f_ecm u_ether usb_f_acm u_serial rfcomm bnep libcomposite configfs snd_hda_codec_hdmi snd_hda_intel arc4 mei_spd gpio_keys ip6table_filter intel_rapl ip6_tables x86_pkg_temp_thermal intel_powerclamp coretemp iwlmvm(O) efivars mac80211(O) clk_wcove typec_wcove intel_bxtwc_tmu gpio_wcove xt_tcpudp iptable_filter ip_tables x_tables snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core snd_soc_sst_match snd_soc_core btusb snd_compress btrtl ac97_bus btbcm pwm_lpss_pci pwm_lpss iwlwifi(O) snd_hda_codec i915 snd_hda_core cfg80211(O) spi_pxa2xx_platform snd_pcm mei_me snd_timer compat(O) processor_thermal_device intel_soc_dts_iosf mei i2c_designware_platform i2c_designware_core dwc3_pci fdp_i2c fdp nci nfc hci_uart btintel int3400_thermal video acpi_thermal_rel int3403_thermal int340x_thermal_zone soc_button_array uio arizona_i2c 5xx_comms_leds(O)

[ 3080.565507] CPU: 2 PID: 2603 Comm: v4l2src0:src Tainted: G W O 4.9.27-intel-pk-standard # 1

[ 3080.575804] Hardware name: Intel Corp. 550x DVT2/SDS, BIOS GTPP1J2A.X64.0143.B30.1706270056 06/27/2017

[ 3080.586199] ffffc90008f2bbe0 ffffffff813fc6da ffffc90008f2bc30 0000000000000000

[ 3080.594474] ffffc90008f2bc20 ffffffff8107bb3b 000005443b304003 ffffc90008f2bda0

[ 3080.602748] 0000000000000000 ffffffffa07ecbc0 ffff88012c581c00 ffff8801399c3700

[ 3080.611024] Call Trace:

[ 3080.613748] [] dump_stack+0x4d/0x63

[ 3080.619488] [] __warn+0xcb/0xf0

[ 3080.624838] [] warn_slowpath_fmt+0x4f/0x60

[ 3080.631257] [] v4l_enum_fmt+0xf4a/0x12c0 [videodev]

[ 3080.638547] [] __video_do_ioctl+0x26d/0x2e0 [videodev]

[ 3080.646128] [] ? get_page_from_freelist+0x8bf/0x9a0

[ 3080.653419] [] video_usercopy+0x38a/0x5e0 [videodev]

[ 3080.660808] [] ? video_ioctl2+0x20/0x20 [videodev]

[ 3080.668003] [] ? mem_cgroup_commit_charge+0x55/0x420

[ 3080.675391] [] video_ioctl2+0x15/0x20 [videodev]

[ 3080.682390] [] v4l2_ioctl+0xbb/0xf0 [videodev]

[ 3080.689194] [] do_vfs_ioctl+0x94/0x5c0

[ 3080.695221] [] ? __fget+0x77/0xb0

[ 3080.700762] [] SyS_ioctl+0x79/0x90

[ 3080.706404] [] entry_SYSCALL_64_fastpath+0x13/0x94

[ 3080.713612] ---[ end trace 302e7fbacfa25676 ]---

[ 3080.718779] ------------[ cut here ]------------

[ 3080.723954] WARNING: CPU: 2 PID: 2603 at /var/lib/jenkins/jobs/release-builder-refos/workspace/build/tmp-glibc/work-shared/intel-5xx-64/kernel-source/drivers/media/v4l2-core/v4l2-ioctl.c:1348 v4l_enum_fmt+0xf4a/0x12c0 [videodev]

[ 3080.746591] Unknown pixelformat 0x45454770

[ 3080.751171] Modules linked in: snd_usb_audio snd_usbmidi_lib snd_hwdep snd_rawmidi uvcvideo snd_seq_device videobuf2_vmalloc 8021q iptable_nat nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv6 nf_conntrack_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 xt_conntrack nf_conntrack asix usbnet libphy intel_ipu4_isys_mod_bxtB0(O) videobuf2_v4l2 videobuf2_core intel_ipu4_psys_mod_bxtB0(O) intel_ipu4_mmu_bxtB0(O) intel_ipu4_mod_bxtB0(O) iova intel_ipu4_acpi(O) videobuf2_dma_contig videobuf2_memops videobuf_core dw9714(O) crlmodule(O) v4l2_common videodev media usb_f_mtp usb_f_ecm u_ether usb_f_acm u_serial rfcomm bnep libcomposite configfs snd_hda_codec_hdmi snd_hda_intel arc4 mei_spd gpio_keys ip6table_filter intel_rapl ip6_tables x86_pkg_temp_thermal intel_powerclamp coretemp iwlmvm(O) efivars mac80211(O) clk_wcove typec_wcove intel_bxtwc_tmu gpio_wcove xt_tcpudp iptable_filter ip_tables x_tables snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc snd_soc_sst_dsp snd_hda_ext_core snd_soc_sst_match snd_soc_core btusb snd_compress btrtl ac97_bus btbcm pwm_lpss_pci pwm_lpss iwlwifi(O) snd_hda_codec i915 snd_hda_core cfg80211(O) spi_pxa2xx_platform snd_pcm mei_me snd_timer compat(O) processor_thermal_device intel_soc_dts_iosf mei i2c_designware_platform i2c_designware_core dwc3_pci fdp_i2c fdp nci nfc hci_uart btintel int3400_thermal video acpi_thermal_rel int3403_thermal int340x_thermal_zone soc_button_array uio arizona_i2c 5xx_comms_leds(O)

[ 3080.892481] CPU: 2 PID: 2603 Comm: v4l2src0:src Tainted: G W O 4.9.27-intel-pk-standard # 1

[ 3080.902779] Hardware name: Intel Corp. 550x DVT2/SDS, BIOS GTPP1J2A.X64.0143.B30.1706270056 06/27/2017

[ 3080.913175] ffffc90008f2bbe0 ffffffff813fc6da ffffc90008f2bc30 0000000000000000

[ 3080.921450] ffffc90008f2bc20 ffffffff8107bb3b 0000054408f2bc38 ffffc90008f2bda0

[ 3080.929726] 0000000000000000 ffffffffa07ecbc0 ffff88012c581c00 ffff8801399c3700

[ 3080.938006] Call Trace:

[ 3080.940734] [] dump_stack+0x4d/0x63

[ 3080.946471] [] __warn+0xcb/0xf0

[ 3080.951821] [] warn_slowpath_fmt+0x4f/0x60

[ 3080.958240] [] v4l_enum_fmt+0xf4a/0x12c0 [videodev]

[ 3080.965532] [] __video_do_ioctl+0x26d/0x2e0 [videodev]

[ 3080.973112] [] ? get_page_from_freelist+0x8bf/0x9a0

[ 3080.980405] [] video_usercopy+0x38a/0x5e0 [videodev]

[ 3080.987793] [] ? video_ioctl2+0x20/0x20 [videodev]

[ 3080.994984] [] ? mem_cgroup_commit_charge+0x55/0x420

[ 3081.002372] [] video_ioctl2+0x15/0x20 [videodev]

[ 3081.009372] [] v4l2_ioctl+0xbb/0xf0 [videodev]

[ 3081.016176] [] do_vfs_ioctl+0x94/0x5c0

[ 3081.022204] [] ? __fget+0x77/0xb0

[ 3081.027745] [] SyS_ioctl+0x79/0x90

[ 3081.033385] [] entry_SYSCALL_64_fastpath+0x13/0x94

[ 3081.040594] ---[ end trace 302e7fbacfa25677 ]---

[ 3081.045761] ------------[ cut here ]------------

[ 3081.050936] WARNING: CPU: 2 PID: 2603 at /var/lib/jenkins/jobs/release-builder-refos/workspace/build/tmp-glibc/work-shared/intel-5xx-64/kernel-source/drivers/media/v4l2-core/v4l2-ioctl.c:1348 v4l_enum_fmt+0xf4a/0x12c0 [videodev]

[ 3081.073570] Unknown pixelformat 0x45456770

[ 3081.078149] Modules linked in: snd_usb_audio snd_usbmidi_lib snd_hwdep snd_rawmidi uvcvideo snd_seq_device videobuf2_vmalloc 8021q iptable_nat nf_nat_ipv4 nf_nat iptable_mangle nf_conntrack_ipv6 nf_conntrack_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 xt_conntrack nf_conntrack asix usbnet libphy intel_ipu4_isys_mod_bxtB0(O) videobuf2_v4l2 videobuf2_core intel_ipu4_psys_mod_bxtB0(O) intel_ipu4_mmu_bxtB0(O) intel_ipu4_mod_bxtB0(O) iova intel_ipu4_acpi(O) videobuf2_dma_contig videobuf2_memops videobuf_core dw9714(O) crlmodule(O) v4l2_common videodev media usb_f_mtp usb_f_ecm u_ether usb_f_acm u_serial rfcomm bnep libcomposite configfs snd_hda_codec_hdmi snd_hda_intel arc4 mei_spd gpio_keys ip6table_filter intel_rapl ip6_tables x86_pkg_temp_thermal intel_powerclamp coretemp iwlmvm(O) efivars mac80211(O) clk_wcove typec_wcove intel_bxtwc_tmu gpio_wcove xt_tcpudp iptable_filter ip_tables x_tables snd_soc_skl snd_soc_skl_ipc snd_soc_sst_ipc s...

Tags (1)
0 Kudos
6 Replies
idata
Community Manager
314 Views

Hi Haibin,

 

 

Thanks for reaching out.

 

 

I would like to encourage you to try the example under "User WebCam from Python or OpenCV" in the Online Guide for the Intel Joule: https://software.intel.com/en-us/node/721526 USB Web Camera. Please make sure you have python pip installed and downloaded the OpenCV python package.

 

 

Let me know if trying that example helps.

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
314 Views

Hi Haibin,

 

 

Did you try the example under "User WebCam from Python or OpenCV"?

 

 

Regards,

 

-Yermi A.

 

HLin35
Beginner
314 Views

Hi Yarmi,

Thanks for the response,

I was using the example as u mentioned, just a little change the device id from (0 to 45, since i didn't reboot my dev kit). Yes , i known this issue disappear after reboot (when the device id is 0, it is working correctly).

After then, i got a camera module (4k camera from Gumstix), i tried to run the python scripts, but it crashed too, and then i checked the dmesg, it seems it is the same problem with the USB web cam(when device is /dev/video45).

Regards,

Haibin Lin

idata
Community Manager
314 Views

Hi Haibin,

 

 

The MIPI cameras output in a RAW format and certain parameters need to be specified. We suggest you to use OpenCV and GStreamer as a back end. You can use the following guide to open the cameras using GStreamer, but you will have to integrate it to OpenCV on your own: https://software.intel.com/en-us/node/721506

 

 

Regards,

 

Diego V.
HLin35
Beginner
314 Views

Hi Diego,

I am not sure i got your idea correctly. Did u mean that i should try to use GStreamer to make a IP video stream, and then use the OpenCV to open that video stream?

Regards,

Haibin Lin

idata
Community Manager
314 Views

Hi,

 

 

That is one way that you can approach it, another way would be to open the Gstreamer pipeline directly from OpenCV. There should be an OpenCV class capable of opening it. However, you would have to do your own research as OpenCV is not supported by us.

 

 

Regards,

 

-Yermi A.
Reply