5
\$\begingroup\$

I have YUY2 video data that I want to be sent over USB to a computer. I want the computer to recognize the device as a video device so it can be displayed with software like a webcam viewer. I have tried searching multiple times on different sites, but I can't find out how to send a packet or when to send what packets. Most things I have found about USB don't tell me how to do these things on a smaller level. I am going to be using a microcontroller and a USB-C port.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ you can get usb video converters for pretty cheap. i just got an hdmi>usb3 one for $12; now my pi shows up like a webcam; no more monitor switching. \$\endgroup\$ – dandavis Jan 25 at 16:45
  • 3
    \$\begingroup\$ Implementing the UVC enough just to show that it works will be a man-month of effort if you're good at it, and perhaps many more if you want to actually pass the validation suite.(and you'll have to set yourself up for that - that may mean expensive software!). You have to ask yourself whether implementing UVC is the right way to go. Perhaps you should license a library that implements it for your microcontroller. Since it's likely Arm, there's no problem finding such commercial libraries. \$\endgroup\$ – Kuba hasn't forgotten Monica Jan 25 at 16:49
15
\$\begingroup\$

You will have to implement the USB profile for video cameras, UVC. It's specified pretty intensely by the USB Special Interest Group UVC documentation archive.

You'll want to start by reading the FAQ document in there, which explains which document specifies what.

\$\endgroup\$
2
  • 3
    \$\begingroup\$ The spec is free? Wow. I used to implement PCI cards and had to buy the spec \$\endgroup\$ – slebetman Jan 26 at 2:30
  • \$\begingroup\$ @slebetman nice, isn't it? \$\endgroup\$ – Marcus Müller Jan 26 at 10:03
8
\$\begingroup\$

As noted in Marcu's answer, you need UVC. This blog has a series of posts that works through the process of interfacing a camera and then implementing UVC on several different devices, including a microcontroller and a dedicated ASIC:

https://www.circuitvalley.com/2019/12/diy-cypress-fx3-usb3-usb-3-uvc-camera-ov7670.html

The source code and linked technical notes provide a complete, working implementation, so should be a very useful starting point. In the past I have found the examples to be extremely useful.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.