Go to Post My puppy certainly thanks the many teams that handed out frisbees this year. - VexisDarksteele [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 31-01-2015, 14:14
codedr codedr is offline
Registered User
FRC #0537
Team Role: Mentor
 
Join Date: Mar 2010
Rookie Year: 2009
Location: Wisconsin
Posts: 71
codedr will become famous soon enoughcodedr will become famous soon enough
Re: USB Camera on C++ SmartDashBoard

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/f...d000063.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.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi