Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20713 Discussions

Video Compression

Altera_Forum
Honored Contributor II
2,543 Views

Hi All, 

 

I'm doing a University project and my biggest hurdle is Video Compression.  

 

I have a Terasic D5M camera which i want to send its video over ethernet. I'm working on the ethernet part (thats another story). 

Because i want to display the video in Windows, i imagine i really should get the video into some sort of streaming standard, MPEG, MJPEG h.264 or something like that. 

 

This is problem is threatening my project.  

What format can i send the video in so i can decode it easily at the other end? 

I've done a alot of research and haven't been able to find a solution. I can't find any open source encoders in HDL. I can't use C ones because the Nios won't be fast enough. 

 

Any ideas? 

 

Perhaps a C code encoder and a "C to Verilog Converter" Is that reliable? 

 

Know of any HDL encoders? 

 

Do you know how to convert raw RGB into a video stream in windows?
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
940 Views

Converting C to HDL is not trivial - so dont spend any time looking for converters. If you cannot find an open source one, you may either need to buy one or write one.

0 Kudos
Altera_Forum
Honored Contributor II
940 Views

Convert that video to Transport Stream, then pack it to UDP packet (RTP or RTSP) and send over ethernet. What is the output of the camera and what is the bitrate? You won't be able to do h264 encoding in FPGA unless You have a lot of money + the resolution and fps are small.

0 Kudos
Altera_Forum
Honored Contributor II
940 Views

The camera outputs a Bayer pattern, which i can convert to RGB or YUV. I am planning to UDP it. 

Bayer pattern has only one colour value for each pixel, if i'm unable to compress, i should keep a Bayer stream as this will be smaller than coverting to a RGB or YUV format. That was my thinking anyway. 

 

Please elaborate on Video transport streams? Aren't they the output of compression only?
0 Kudos
Altera_Forum
Honored Contributor II
940 Views

Check out opencores.org. There is a project under the 'Video Controller' tab and than there are some decoders as well as a project labeled 'Video Compression System'. That has MPEG-2,4 and part 10 (H.264) with HDL code. In my opinion I suggest to use YUV output before encoding. This has several advantages. Motion estimation is done on Y, UV can be subsampled further and if necessary (bitrate limits) dropped off.

0 Kudos
Altera_Forum
Honored Contributor II
940 Views

That x264 project was never made to work...

0 Kudos
Altera_Forum
Honored Contributor II
940 Views

The only one I know of is the Hardh.264 encoder also known as the Zexia. 

This is on sourceforge, but only a handful of people have downloaded it. Unfortunately my Uni project scope is so much bigger than compression so I can't allow it to consume all my time.  

Unless someone can help, for the time being I have to back burn this until i attack the rest of my scope. 

 

Note there is a big difference between decoders and encoders. Encoders are far more complex.  

 

Doddy. I've replied to your PM and can send you all the fruits of my compression research. This is avaliable for anyone else if they wish, it should definately give you a leg up. As stated i'll be able to support you through your work, i just can't put all my time to it thats all.
0 Kudos
Altera_Forum
Honored Contributor II
940 Views

Just a basic question: does it work? 

 

If yes: is it resource eater? Maybe some quick report stuff?
0 Kudos
Altera_Forum
Honored Contributor II
940 Views

Well one person seems to think so. It is complex so i assume it'll be fairly resource intense as h.264 is the most advanced compression technique. 

 

The link below is basically a blog of a guy who is into Video FPGA work and links to the Zexia encoder. He backs this core, but not many have downloaded it. So it would need to be tested. I'm considering doing that, but that will be after i attack the rest of my scope, which could be 2 months or more. 

http://www.drtonygeorge.com/video/h264/h264_rtl.htm Guys Blog 

http://hardh264.sourceforge.net/h264-encoder-manual.html Core manual 

 

I'm more than happy to support anyone else who wants to take point on testing. Let me know. 

 

PS: Remember i have some good texts and info on the subject. If you wish, send me a PM with your email and i can forewared it all on.
0 Kudos
Altera_Forum
Honored Contributor II
940 Views

Hi Altera Users,  

 

can anyone please give me a feedback about the Zexia encoder ? 

 

Will it work with the D5M camera ?  

 

i would be very grateful for any feedback ! 

Jalayan
0 Kudos
Reply