Motion JPEG Codec on CUDA for High FPS Video
Updated:
Fastvideo CUDA MJPEG codec compresses and decompresses Motion JPEG streams entirely on the GPU, reaching 5500 fps of Full HD encoding on the NVIDIA GeForce RTX 4090. Motion JPEG is video built from independent JPEG frames, and that independence is exactly what makes it the format of choice when frame rates go extreme. The codec is the video counterpart of our Fast JPEG codec: the same fully parallel per-frame engine, applied to continuous streams.
Detailed benchmark data. Measured results are published on our benchmark pages: JPEG codec benchmarks, all benchmarks.
A large web service processed over 400,000 JPEG images per second on our SDK.
Why MJPEG for High Speed Video
Inter-frame codecs — H.264, H.265, AV1 — achieve better compression ratios, but their encoders are built around motion estimation between frames and cannot sustain the frame rates that high speed cameras produce. MJPEG has no inter-frame dependencies: every frame is encoded on its own, so the throughput scales with the JPEG engine, and on the GPU that means video encoding at 1000 fps and far beyond. For high speed imaging, MJPEG is effectively the only option for real-time encoding — and as a bonus, every frame of the recording is individually seekable and extractable, which inter-frame formats cannot offer.
Features of the Motion JPEG Codec on CUDA
- Grayscale (8-bit) and color (24-bit) MJPEG streams
- Subsampling modes: 4:4:4, 4:2:2, 4:2:0
- Fully parallel encoding and decoding on the GPU, in real-time
- Compatibility with FFmpeg to read and write MJPEG streams (FFmpeg is under LGPL v2.1)
- 12-bit MJPEG on the basis of our 12-bit JPEG codec
- OS: Windows 10/11, Linux Ubuntu, L4T; CUDA 12.6
MJPEG Benchmarks on the NVIDIA GeForce RTX 4090
| Motion JPEG on NVIDIA GeForce RTX 4090 (Full HD, single-thread) | Throughput |
| MJPEG encoding | up to 5500 fps |
| MJPEG decoding | up to 1500 fps |
Test conditions: Full HD frames (1920×1080, 8-bit per channel, RGB), all data in GPU memory, timing includes GPU computations only, quality 95, subsampling 4:4:4. Hardware: NVIDIA GeForce RTX 4090 (PCIe 4.0 x16), CPU AMD Ryzen 9 7950X. Software: Windows 10/11, CUDA 12.6.
- MJPEG encoding — up to 5500 fps
- MJPEG decoding — up to 1500 fps
These numbers are for a single-threaded application; multithreading improves them further, and on Linux the CUDA MPS mode adds another gain. Benchmarks for other frame sizes are collected on the SDK benchmarks page.
MJPEG inside a Camera Pipeline
The codec rarely works alone: in high speed camera applications it is the final stage of a GPU pipeline. We offer the combined debayer and JPEG encoder as a ready pair, and the full chain — acquisition, dark frame subtraction, flat-field correction, white balance, denoising, demosaicing, color correction, LUTs, tone mapping, crop/resize/remap, sharpening, and MJPEG compression — is available from the Fastvideo SDK. This is exactly the configuration used in our own GPU RAW Processor and FastVCR software, where MJPEG recording keeps up with the camera at full resolution and frame rate.
Roadmap for the CUDA MJPEG Codec
Recently released:
- 12-bit CUDA JPEG codec
- MJPEG codec on GPU for FFmpeg
- Integration into the GPU RAW Processor
In progress:
- Minimum memory usage on GPU
- More input/output formats for the MJPEG codec (YCbCr, YV12, etc.)
- Real-time MJPEG streaming
Support
- Full technical support up to successful integration
- SDK, documentation, and benchmarks
For further information about the CUDA MJPEG codec, a demo, or a quotation, contact us via the form below.