AVI container and VGA display

May 20, 2011 1 Replies

hi all! I'm working on the Spartan 3E started with mapping MJPEG decoder. I had the source code of the JPEG deccoding, now I use AVI container to display MJPEG via VGA port. I wanna find the first image inside of AVI container but I don't understand the AVI's structure. it has some index such as super index, old index, ect. And I don't know how to display video into monitor via VGA port. any body has idea for my problems? Please, help me!



thanks alot!


--------------------------------------- Posted through

formatting link


he

EG

I was acutally doign somethign similar not too long ago. I was receiving video into an FPGA and trying to write out to and SDXC card in AVI format. I didn't finish this, got pulled into something else. But after hours I figured out AVI is formatted and wrote a C program to pull out the data. If you get your code please email it me to snipped-for-privacy@gmail.com. Below are the links I used to figure it out.

formatting link

formatting link

Basically a typical byte stream looks like this:

[52 49 46] [46 B0 2C ][07 00 41] 56 49 20 4C 49 53 54 D2 00 00 00 68 64 72 6C 61 76 69 68 38 00 00 00 1A 41 00 00 28 FC 00 00 00 00 00 00 10 08 00 00 8C 00 00 00 00 00 00 00 01 00 00 00 0C 1E 00 00 00 01 00 00 00 01 00 00 00 00

If you look at those links it tells you how AVI is formatted.

You will see it is

'RIFF' + 4 byte file length + 'AVI' + 'LIST' + 4 byte list length + 'hdrl' + 'avih' + 4 byte chunk size + (data)

It is liek a hierarchy where RIFF contains AVI and AVI contains LIST and LIST contains hdrl etc.. until you get down to the image. Each time you get a container you get a label and size, so from the size you know how many bytes to count to the header.

Hope that helps.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required