GStreamer adds lossless zlib, deflate, and Brotli compression for MP4 and raw video
New GStreamer elements enable lossless compression of raw and Bayer video data within standard MP4 containers using zlib, deflate, and Brotli.
Summary
Collabora has introduced lossless compression capabilities to the GStreamer multimedia framework to support scientific and geospatial imaging. Unlike mainstream lossy codecs like H.264 or AV1, these new features preserve every pixel, which is critical for multispectral sensors, thermal cameras, and depth maps where data integrity is paramount.
The update includes new compression elements in the gst-plugins-rs plugin and extends MP4 support via isomp4mux and qtdemux. These changes allow users to shrink raw video files by up to 1.9× while maintaining full bit-perfect accuracy. The functionality is currently available in the GStreamer 1.29 development series and is slated for inclusion in the GStreamer 1.30 release.
Technical implementation and ISO compliance
- New Compression Elements: The gst-plugins-rs plugin now provides three pairs of elements: zlibcompress/zlibdecompress, deflatecompress/deflatedecompress, and brotlicompress/brotlidecompress.
- Standardized MP4 Integration: Using the ISO/IEC 23001-17 standard, isomp4mux can write compressed streams to MP4 containers, while qtdemux in gst-plugins-good can read them back.
- Metadata Preservation: The system uses an 'original-caps' field within the compressed buffer to store the source format (e.g., NV12, RGB, or Bayer), allowing the decompressor to reconstruct the exact pixel format without manual capsfilters.
- Bayer Support: The implementation explicitly handles video/x-bayer, the raw mosaic output common in most hardware image sensors, ensuring scientific data remains intact.
- Container Metadata: The MP4 sample entry uses restricted video entries (resv) and component definitions (cmpd) to describe bit depth, subsampling, and plane layout for the compressed data.
Why it matters
This development provides a standardized way for geospatial, scientific, and automotive industries to store high-fidelity sensor data without the massive storage overhead of uncompressed raw video. By adhering to ISO/IEC 23001-17, these files remain interoperable with any compliant MP4 tool, not just GStreamer-based applications.
Original reference: www.collabora.com →