6 Replies Latest reply on Sep 27, 2017 1:44 PM by Intel Corporation

    VIDEOIO ERROR: V4L: index 45 is not correct!

    Haibin

      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]  [<ffffffff813fc6da>] dump_stack+0x4d/0x63

      [ 3080.619488]  [<ffffffff8107bb3b>] __warn+0xcb/0xf0

      [ 3080.624838]  [<ffffffff8107bbaf>] warn_slowpath_fmt+0x4f/0x60

      [ 3080.631257]  [<ffffffffa072fafa>] v4l_enum_fmt+0xf4a/0x12c0 [videodev]

      [ 3080.638547]  [<ffffffffa07306dd>] __video_do_ioctl+0x26d/0x2e0 [videodev]

      [ 3080.646128]  [<ffffffff81152dff>] ? get_page_from_freelist+0x8bf/0x9a0

      [ 3080.653419]  [<ffffffffa07301fa>] video_usercopy+0x38a/0x5e0 [videodev]

      [ 3080.660808]  [<ffffffffa0730470>] ? video_ioctl2+0x20/0x20 [videodev]

      [ 3080.668003]  [<ffffffff811a9955>] ? mem_cgroup_commit_charge+0x55/0x420

      [ 3080.675391]  [<ffffffffa0730465>] video_ioctl2+0x15/0x20 [videodev]

      [ 3080.682390]  [<ffffffffa072b66b>] v4l2_ioctl+0xbb/0xf0 [videodev]

      [ 3080.689194]  [<ffffffff811c1c74>] do_vfs_ioctl+0x94/0x5c0

      [ 3080.695221]  [<ffffffff811cc897>] ? __fget+0x77/0xb0

      [ 3080.700762]  [<ffffffff811c2219>] SyS_ioctl+0x79/0x90

      [ 3080.706404]  [<ffffffff81917460>] 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]  [<ffffffff813fc6da>] dump_stack+0x4d/0x63

      [ 3080.946471]  [<ffffffff8107bb3b>] __warn+0xcb/0xf0

      [ 3080.951821]  [<ffffffff8107bbaf>] warn_slowpath_fmt+0x4f/0x60

      [ 3080.958240]  [<ffffffffa072fafa>] v4l_enum_fmt+0xf4a/0x12c0 [videodev]

      [ 3080.965532]  [<ffffffffa07306dd>] __video_do_ioctl+0x26d/0x2e0 [videodev]

      [ 3080.973112]  [<ffffffff81152dff>] ? get_page_from_freelist+0x8bf/0x9a0

      [ 3080.980405]  [<ffffffffa07301fa>] video_usercopy+0x38a/0x5e0 [videodev]

      [ 3080.987793]  [<ffffffffa0730470>] ? video_ioctl2+0x20/0x20 [videodev]

      [ 3080.994984]  [<ffffffff811a9955>] ? mem_cgroup_commit_charge+0x55/0x420

      [ 3081.002372]  [<ffffffffa0730465>] video_ioctl2+0x15/0x20 [videodev]

      [ 3081.009372]  [<ffffffffa072b66b>] v4l2_ioctl+0xbb/0xf0 [videodev]

      [ 3081.016176]  [<ffffffff811c1c74>] do_vfs_ioctl+0x94/0x5c0

      [ 3081.022204]  [<ffffffff811cc897>] ? __fget+0x77/0xb0

      [ 3081.027745]  [<ffffffff811c2219>] SyS_ioctl+0x79/0x90

      [ 3081.033385]  [<ffffffff81917460>] 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 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)

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

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

      [ 3081.240121]  ffffc90008f2bbe0 ffffffff813fc6da ffffc90008f2bc30 0000000000000000

      [ 3081.248396]  ffffc90008f2bc20 ffffffff8107bb3b 0000054408f2bc38 ffffc90008f2bda0

      [ 3081.256670]  0000000000000000 ffffffffa07ecbc0 ffff88012c581c00 ffff8801399c3700

      [ 3081.264946] Call Trace:

      [ 3081.267674]  [<ffffffff813fc6da>] dump_stack+0x4d/0x63

      [ 3081.273411]  [<ffffffff8107bb3b>] __warn+0xcb/0xf0

      [ 3081.278758]  [<ffffffff8107bbaf>] warn_slowpath_fmt+0x4f/0x60

      [ 3081.285175]  [<ffffffffa072fafa>] v4l_enum_fmt+0xf4a/0x12c0 [videodev]

      [ 3081.292464]  [<ffffffffa07306dd>] __video_do_ioctl+0x26d/0x2e0 [videodev]

      [ 3081.300045]  [<ffffffff81152dff>] ? get_page_from_freelist+0x8bf/0x9a0

      [ 3081.307336]  [<ffffffffa07301fa>] video_usercopy+0x38a/0x5e0 [videodev]

      [ 3081.314724]  [<ffffffffa0730470>] ? video_ioctl2+0x20/0x20 [videodev]

      [ 3081.321917]  [<ffffffff811a9955>] ? mem_cgroup_commit_charge+0x55/0x420

      [ 3081.329305]  [<ffffffffa0730465>] video_ioctl2+0x15/0x20 [videodev]

      [ 3081.336305]  [<ffffffffa072b66b>] v4l2_ioctl+0xbb/0xf0 [videodev]

      [ 3081.343108]  [<ffffffff811c1c74>] do_vfs_ioctl+0x94/0x5c0

      [ 3081.349135]  [<ffffffff811cc897>] ? __fget+0x77/0xb0

      [ 3081.354677]  [<ffffffff811c2219>] SyS_ioctl+0x79/0x90

      [ 3081.360317]  [<ffffffff81917460>] entry_SYSCALL_64_fastpath+0x13/0x94

      [ 3081.367525] ---[ end trace 302e7fbacfa25678 ]---

      [ 3081.372691] ------------[ cut here ]------------

      [ 3081.377866] 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.400506] Unknown pixelformat 0x45455270

      [ 3081.405087] 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)

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

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

      [ 3081.567092]  ffffc90008f2bbe0 ffffffff813fc6da ffffc90008f2bc30 0000000000000000

      [ 3081.575367]  ffffc90008f2bc20 ffffffff8107bb3b 0000054408f2bc38 ffffc90008f2bda0

      [ 3081.583643]  0000000000000000 ffffffffa07ecbc0 ffff88012c581c00 ffff8801399c3700

      [ 3081.591921] Call Trace:

      [ 3081.594650]  [<ffffffff813fc6da>] dump_stack+0x4d/0x63

      [ 3081.600389]  [<ffffffff8107bb3b>] __warn+0xcb/0xf0

      [ 3081.605740]  [<ffffffff8107bbaf>] warn_slowpath_fmt+0x4f/0x60

      [ 3081.612159]  [<ffffffffa072fafa>] v4l_enum_fmt+0xf4a/0x12c0 [videodev]

      [ 3081.619451]  [<ffffffffa07306dd>] __video_do_ioctl+0x26d/0x2e0 [videodev]

      [ 3081.627033]  [<ffffffff81152dff>] ? get_page_from_freelist+0x8bf/0x9a0

      [ 3081.634326]  [<ffffffffa07301fa>] video_usercopy+0x38a/0x5e0 [videodev]

      [ 3081.641714]  [<ffffffffa0730470>] ? video_ioctl2+0x20/0x20 [videodev]

      [ 3081.648905]  [<ffffffff811a9955>] ? mem_cgroup_commit_charge+0x55/0x420

      [ 3081.656293]  [<ffffffffa0730465>] video_ioctl2+0x15/0x20 [videodev]

      [ 3081.663293]  [<ffffffffa072b66b>] v4l2_ioctl+0xbb/0xf0 [videodev]

      [ 3081.670096]  [<ffffffff811c1c74>] do_vfs_ioctl+0x94/0x5c0

      [ 3081.676123]  [<ffffffff811cc897>] ? __fget+0x77/0xb0

      [ 3081.681665]  [<ffffffff811c2219>] SyS_ioctl+0x79/0x90

      [ 3081.687304]  [<ffffffff81917460>] entry_SYSCALL_64_fastpath+0x13/0x94

      [ 3081.694512] ---[ end trace 302e7fbacfa25679 ]---

      GStreamer Plugin: Embedded video playback halted; module v4l2src0 reported: Could not read from resource.

      OpenCV Error: Unspecified error (GStreamer: unable to start pipeline

      ) in cvCaptureFromCAM_GStreamer, file /usr/src/debug/opencv/3.2+gitAUTOINC+70bbf17b13-r0/git/modules/videoio/src/cap_gstreamer.cpp, line 832

      VIDEOIO(cvCreateCapture_GStreamer(CV_CAP_GSTREAMER_V4L2, reinterpret_cast<char *>(index))): raised OpenCV exception:

       

      /usr/src/debug/opencv/3.2+gitAUTOINC+70bbf17b13-r0/git/modules/videoio/src/cap_gstreamer.cpp:832: error: (-2) GStreamer: unable to start pipeline

      in function cvCaptureFromCAM_GStreamer

       

      Warning: unable to open video source:  45

      Traceback (most recent call last):

        File "RealtimeDetection3.py", line 264, in <module>

          ret,imgs = facedetector.detect_faces(video_src)

        File "/home/root/AicFaceDetection/FaceDetector.py", line 427, in detect_faces

          return self.cam_capture(camera_index, cascade, False)

        File "/home/root/AicFaceDetection/FaceDetector.py", line 356, in cam_capture

          self.cam.set(capPropId("FRAME_WIDTH"), FRAME_WIDTH)

      AttributeError: 'VideoSynthBase' object has no attribute 'set'