This project provides GStreamer plugins in order to compress and decompress data with zlib.
Two plugins are provided:
- gzenc: plugin for compressing data.
- gzdec: plugin for decompressing data.
Two formats are supported for now:
- zlib compressed format (RFC 1950).
- gzip compressed format (RFC 1952).
GStreamer 1.0 and 0.10 are both supported.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
These plugins have been tested on Ubuntu 16.04
You should install those dependencies:
# Basic build tools:
sudo apt-get install git build-essential automake libtool itstool gtk-doc-tools yelp-tools gnome-common gnome-doc-utils yasm flex bison
# Zlib:
sudo apt install zlib1g-dev
# GStreamer 1.0:
sudo apt install gstreamer1.0-plugins-base libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstreamer1.0-0
# GStreamer 0.10:
sudo apt install gstreamer0.10-plugins-base libgstreamer-plugins-base0.10-dev libgstreamer0.10-dev libgstreamer0.10-0
Clone the git repository:
git clone https://github.com/Snec/gst-gz.git
Build and install the plugins:
cd gst-gz
./autogen.sh
./configure --with-gstreamer-api=1.0
make
sudo make install
You can choose which GStreamer version to use with the --with-gstreamer-api
option. (--with-gstreamer-api=0.10 to use GStreamer 0.10)
echo "This is a test ..." > file.txt
GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 gst-launch-1.0 -v filesrc location=file.txt ! gzenc ! filesink location=file.txt.gz
GST_PLUGIN_PATH=/usr/local/lib/gstreamer-1.0 gst-launch-1.0 -v filesrc location=file.txt.gz ! gzdec ! filesink location=file_dec.txt
if cmp -s "file.txt" "file_dec.txt"; then echo "Test failed"; else echo "Test succed"; fi
SRC template: 'src' Availability: Always Capabilities: application/x-gzip
SINK template: 'sink' Availability: Always Capabilities: ANY
- compression-level : The compression level must be -1, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). -1 requests a default compromise between speed and compression (currently equivalent to level 6).
- memory-level : The memory-level parameter specifies how much memory should be allocated for the internal compression state. memory-level=1 uses minimum memory but is slow and reduces compression ratio; memory-level=9 uses maximum memory for optimal speed. The default value is 8.
- strategy : The strategy parameter is used to tune the compression algorithm. (default/filtered/huffman/rle/fixed)
- format : Type of format generated. (gzip/zlib)
SINK template: 'sink' Availability: Always Capabilities: application/x-gzip
SRC template: 'src' Availability: Always Capabilities: ANY
- first-buffer-size : Size of first buffer (used to determine the mime type of the uncompressed data).
- buffer-size : Buffer size.
Add support for deflate compressed format (RFC 1951)
- Alexandre Esse - Initial work - Snec
This project is licensed under the LGPL License - see the LICENSE file for details.