Long recording from a high speed camera
Updated:
The hard part of high speed recording is duration. Cameras stream to PC RAM over PCIe or CameraLink, and a raw stream of ~800 MB/s or more fills the available RAM in seconds. The fix is to compress the incoming stream on the fly at a 10–20× ratio so it can be written to HDD/SSD/RAID in real time. A CPU cannot keep up, so we do it on the GPU with NVIDIA CUDA.
Why Baseline JPEG
Baseline JPEG (8/24‑bit) meets every requirement for this job: it parallelises well, gives good quality at 10–20× compression, is not too computationally heavy, divides into many small sub‑tasks with little per‑thread memory, and is an open standard with encoders and decoders on every platform. We made every stage parallel — including Huffman entropy coding, long thought to be inherently serial — so the whole codec runs on the GPU with nothing off‑loaded to the CPU.
Why not a CPU encoder
This is not an argument about image quality: libjpeg‑turbo produces good JPEGs, and so do we. The difference is what the encoding costs everywhere else in the system.
A CPU encoder saturates a core at a few hundred megapixels per second, so reaching thousands of frames per second means spending every core you have on compression — precisely the cores the application needs for acquisition, storage and analysis. Under load the encode time also stops being constant, and frames begin to arrive late or not at all. And if the image was produced by a GPU ISP, encoding on the CPU means copying it back across PCIe first and copying the result forward again. Encoding where the data already is removes all three costs and leaves the CPU to the application.
Specifications, benchmarks and licensing for this module are on the product page: GPU JPEG codec at fastcompression.com.
Beyond compression
The encoder can be extended with a full image processing pipeline: bad pixel removal, dark frame subtraction, shading correction, white balance, demosaicing, colour correction, denoising, 1D/3D LUT, gamma, online resize/crop/rotate/sharpen, OpenGL output, FFmpeg integration, Bayer and JPEG2000 compression.