View Full Version : JPG Save Performance

July 13, 2007, 14:45:28

I'm currently saving JPG images at 1280*960 at irregular intervals using the following code:

icImagingControl1.ImageActiveBuffer.SaveAsJpeg(fil ename, 70);

This could be near to the camera frame rate.

This method seems to take a lot of processing power, however if I save the video as an AVI with the ffdshow MJPEG compressor the load above the live video load is much lower (even when I output those frames as individual files).

Is there any way to speed up this saving?


Stefan Geissler
July 16, 2007, 09:35:04
Hi Greg,

I am very sorry, but there is no method to speed the jpg compression up, except you find a library, which does it faster (e.g. CxImage, OpenCV (I do not know, whethere these are faster.)). You should also keep in mind that MemorySnapImage returns after a new frame has been delivered. In worst case, it can wait nearly the double frame rate time. Thus you can not use it near the camera's frame rate reliable.

July 31, 2007, 17:26:29
ok thanks, is there then a way to compress an image from the ring buffer, perhaps on a seperate thread, so that it doesn't interrupt capture?

Stefan Geissler
July 31, 2007, 17:29:28
Hi Greg,
If the ring buffer size is greater than one, then the capture will not be interrupted, except all members of the ring buffer are locked. Image buffer locking is done manually by a call to ImageBuffer.Lock (http://www.imagingcontrol.com/support/documentation/dotnet/meth_descImageBuffer_Lock.htm)