USB Camera on C++ SmartDashBoard

Hi there! We are having trouble getting an image of a USB camera on to the C++ Smartdashboard. We have the video feed on the Default smartdashboard and it works fine, however when we change to the C++ dashboard we get the error “Huffman table 0x00 was not defined”.

Any ideas?
Thanks,
Team 2053

We are facing the same issue. I saved an image coming from the roborio and decoded the jpeg header.

The jpeg image coming from the camera is part of a mjpeg stream. According to https://www.ffmpeg.org/ffmpeg-bitstream-filters.html, the jpeg image is missing the DHT (huffman table) section.

> Unfortunately, these chunks are incomplete JPEG images, because they lack
> the DHT segment required for decoding.
> Quoting from http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml:
>
> Avery Lee, writing in the rec.video.desktop newsgroup in 2001, commented
> that “MJPEG, or at least the MJPEG in AVIs having the MJPG fourcc, is
> restricted JPEG with a fixed – and omitted – Huffman table. The JPEG
> must be YCbCr colorspace, it must be 4:2:2, and it must use basic Huffman
> encoding, not arithmetic or progressive. . . . You can indeed extract the
> MJPEG frames and decode them with a regular JPEG decoder, but you have to
> prepend the DHT segment to them, or else the decoder won’t have any idea
> how to decompress the data. The exact table necessary is given in the
> OpenDML spec.”
>
> This bitstream filter patches the header of frames extracted from an
> MJPEG stream (carrying the AVI1 header ID and lacking a DHT segment)
> to produce fully qualified JPEG images.

That’s good info. I still don’t understand why it works fine with the default Dashboard vs the C++ dashboard. My guess is the RoboRio is transporting the exact same stream to the Driver Station in either case, and for some reason using the C++ dashboard it fails.

I asked in another thread if anyone could explain what the difference is between the C++ dashboard and default dashboard, and no one can explain that, either.

I’m not sure this will solve your problems, but, after having the same problem, I searched around and found out that this error showed up when you were using a 64-bit environment. What I did was download the 32-bit Java (even though the computer was still 64-bit) and that specific error went away.

We still don’t have the camera working, but at least that one error was fixed! Still trying to have camera images on the SFX SmartDashboard (or the C++ dashboard if that’s all we can do). Our idea was to try and use two cameras, but we can’t even figure a single one out…

I’m not sure this will solve your problems, but, after having the same problem, I searched around and found out that this error showed up when you were using a 64-bit environment. What I did was download the 32-bit Java (even though the computer was still 64-bit) and that specific error went away.

Yeah, we have tried that. However, the error did not go away when we did that. Now, it has gotton worse because we cant launch the C++ dashboard from the driverstation. We are working around this issue by just making a shortcut to the desktop and launch the dashboard from there.

And we still have not solved the issue of getting the camera on the C++ dashboard. We will probably just end up using the Axis camera.

We ran into this issue tonight as well (in Java). we weren’t able to fix it for the simple camera example or for AutomaticCapture but the Intermediate Vision example was able to run just fine for us on regular SmartDashboard.

The following thread has a WPI person indicating that USB cameras on SFX dashboard is not supported:

http://www.chiefdelphi.com/forums/showthread.php?t=133421