wlhe / uvc-gadget

enhance uvc-gadget test application
GNU General Public License v2.0
140 stars 143 forks source link

uvc_events_process_data get a wrong format #13

Closed FreddieGeorge closed 1 year ago

FreddieGeorge commented 1 year ago

I changed some default setting in source code that I didn't need to input a lot of param, I wanna output 1280x720p MJPEG format..

When I run the app in my board, It can find a video device in Ubuntu. But it lost when I try to open the device in VLC , cheese or other application.

And I add some printf and found that, I got a format change in uvc_evetns_process_data, It printed YUYV which I dont need.

Is it driver or kernel problem? I use Linux kunos 4.9.170

[root@/]$ /mnt/uvc-gadget -d
uvc device is sunxi_usb_udc on bus gadget
uvc open succeeded, file descriptor = 3
uvc fd = 3
UVC: Setting format to: MJPG 1280x720
control request (req 86 cs 02)
streaming request (req 87 cs 01)
streaming request (req 01 cs 01)
setting probe control, length = 34
uvc_events_process_data : format->fcc = YUYV
kbingham commented 1 year ago

I expect your camera doesn't support MJPEG. What device are you running on, and what camera are you trying to expose over UVC?

It might be worth looking at https://gitlab.freedesktop.org/camera/uvc-gadget/ ... which now incorporates an MJPEG encoder (but only through the libcamera path so far).

FreddieGeorge commented 1 year ago

Thank you. I'm running on Allwinner T5 board. My camera does not support MJPEG, it use NV21 format. But I also try to load a jpg picture by using ./uvc-gadget -i /root/image.jpg, it still not work, is it also the camera problem?

I'll try that code these day. Thanks a lot.

kbingham commented 1 year ago

Test with the new version on gitlab.freedesktop.org. If you still have issues I can support you on that version, but not this one - it's too old. Please make an issue on

FreddieGeorge commented 1 year ago

Thanks again! I'll try this version and also make issue on it if I still cant make it work