esp-idf-video-streaming
esp-idf-video-streaming copied to clipboard
libuvc/libuvc.h: No such file or directory
I get the following error while building:
esp-idf-video-streaming/main/main.c:8:10: fatal error: libuvc/libuvc.h: No such file or directory 8 | #include "libuvc/libuvc.h" | ^~~~~~~~~~~~~~~~~
vs code shows missing files
Where can I get the these files?
This project uses USB-HOST, so you need ESP32S2/S3. It cannot be built on the ESP32 target.
The following steps are required:
idf.py set-target {esp32s2/esp32s3}
idf.py menuconfig
idf.py flash monitor
You need an environment where this can be built. https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/uvc
Although vs code looks simple, it is very difficult to explain how to solve such problems when they occur.
USB-HOST 2.0.0 version does not contain the required files. From changelog:
2.0.0 New version of the driver, native to Espressif's USB Host Library Removed libuvc dependency
We need to use 1.0.4
I believe the USB-HOST 2.0.0 version hasn't been officially released yet, am I wrong?
(EDIT) I found that USB-HOST 2.0.0 version has been officially released.
It will take some time to confirm version 2.0.0 as we need to test many cameras.
Thank you for the report.
https://components.espressif.com/components/espressif/usb_host_uvc/versions/2.0.0
We found that v1.0.4 and v2.0.0 of the usb_host_uvc component are completely different.
This is a breaking change.
Supporting v2.0.0 would require major modifications.
As a temporary workaround, we added the ability to specify the component version.
Pls try latest.
We will keep this issue open until we support v2.0.0.
Only a limited number of cameras work with v1.0.4.
We hope that v2.0.0 will support a larger number of USB cameras.
Thank again.
I used this sample to try out the UVC driver v2. https://github.com/espressif/esp-usb/tree/master/host/class/uvc/usb_host_uvc/examples/basic_uvc_stream
I used Logitech C615. It does not work with esp-idf's usb_host_uvc v2.
I have about 30 USB cameras. I tried it, but there were no cameras added with UVC driver v2. There doesn't seem to be much benefit to migrating to UVC driver v2.
linux libuvc
The Logitech C615 can capture in YUY2, 640x480.
First format: (YUY2) 640x480 30fps
bmHint: 0001
bFormatIndex: 1
bFrameIndex: 1
dwFrameInterval: 333333
wKeyFrameRate: 0
wPFrameRate: 0
wCompQuality: 61
wCompWindowSize: 0
wDelay: 0
dwMaxVideoFrameSize: 614400
dwMaxPayloadTransferSize: 3060
bInterfaceNumber: 3
Streaming...
Enabling auto exposure ...
... full AE not supported, trying aperture priority mode
... enabled aperture priority auto exposure mode
callback! frame_format = 3, width = 640, height = 480, length = 614400, ptr = 12345
callback! frame_format = 3, width = 640, height = 480, length = 614400, ptr = 12345
callback! frame_format = 3, width = 640, height = 480, length = 614400, ptr = 12345
esp-idf libuvc
It can't capture in YUY2 and 640x480.
I (2255) UVC example: Opening UVC device 0x0000:0x0000-0
[email protected]...
I (2255) UVC example: UVC_VS_FORMAT_YUY2
I (2255) main_task: Returned from app_main()
E (2985) USBH: Dev 1 EP 0 Error
E (2985) uvc: uvc_host_usb_ctrl(827): Control transfer error
E (2985) uvc-control: uvc_host_stream_control(66): Control request failed
E (2995) USBH: HCD Pipe not in active state
E (2995) USB HOST: Submit CTRL URB error: ESP_ERR_INVALID_STATE
E (3005) uvc: uvc_host_usb_ctrl(821): CTRL transfer failed
E (3015) uvc-control: uvc_host_stream_control(66): Control request failed
E (3015) uvc: uvc_host_stream_open(545): Failed to negotiate requested Video Stream format
I (3025) UVC example: USB: All devices freed
I (3035) UVC example: Failed to open device