Electronic – format of output data of a webcam

fpga

I'm in the situation of turning a Spatran3 FPGA into a classic USB webcam (Yes it's weird I know).

I have a thermal analog camera which is connected to a SAA7113H ADC. I need to interface USB port of FPGA board to a Linux desktop system, such that v4l see a webcam on USB port (and users can grab frames from USB port using OpenCV). At this point some question arise:

  1. What is output format of a webcam?
  2. Do webcams contain some encoders? Or they send raw data?
  3. Do I have to implement an OS-level protocol like IEEE 1394 on FPGA?

(Note: I'm a software engineer, having a poor knowledge on electronics)

Best Answer

If you want to do it all in hardware... Good luck. You need to implement the USB standard, or at least a part of it, then find a way to translate whatever your ADC sends in usb packets.

If you can integrate a processor in your FPGA that would be so much simpler. With altera you can integrate the nios II processor, so I believe xilinx has its own processor. When you have the processor you can add a memory mapped usb interface, which usually is provided by the FPGA vendor, then do things in software. That's slower, but again, that's much easier. Of course you will need a custom port in your processor that talks to the ADC.

If you have enough memory you can even run some flavour of linux on the FPGA...

To direclty answer your questions:

1) Look it up, there are several standards and maybe it's easier to use one instead of another. 2) I believe they send compressed data, I am not sure though. 3) That depends on what your linux machine expects

Just a final guess: if you bought that ADC it means that you know how to hook it up to your IR cam, I'm guessing that IC's that accepts that kind of analog input and translate it to a USB port exist. Your project might be as easy as soldering a dozen of wires.

Related Topic