views:

33

answers:

1

Hi,

I'm trying to encode and transfer raw video frames over LAN (100 Mbps) connection (frames captured by a web cam). What video/image encoding format is recommended for fast compression (with not much regard for the compression ratio) ?

Thanks,

+2  A: 

If you need individual frames to be independent of one another, use mjpeg (which is equivalent to encoding each frame as a jpeg). It's simple and you have plenty of tools with which to manipulate it.

Otherwise, as long as you have a remotely modern cpu and the resolution isn't insanely high, just use a simple mpeg4 asp or even h264 profile. Encoding 320x240 video with the simplest profile should take less than 5% cpu on a current low-end machine.

R..
Thanks R. Unfortunately mjpeg/jpeg compression seem to result in lower framerate . Encoding each frame as PNG seem to move the rate upto 11 fps. Still looking for ways to compress faster :(.
ivymike
Something's wrong if it's taking that long. Which library are you using to do the compression?
R..
Hi R. I'm using the Gdiplus (Image class) for quick conversion between pixel data to other formats. It can hardly perform 3 jpeg conversions/sec (for a 1024x768 size frame with true color).
ivymike
Then this is your problem. Inefficient libs like that might work for 160x120 or maybe even 320x240, but for high resolution you really need to switch to `libavcodec`. One way you can tell your library is bad is that it's slower than compressing as png! Any good jpeg implementation should encode at least a few times (if not orders of magnitude) faster than png.
R..