Skip to content
/ gst-gz Public

GStreamer plugin for gzip and zlib compression and decompression.

License

Notifications You must be signed in to change notification settings

Snec/gst-gz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zlib based GStreamer plugins

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.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

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

Installing

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)

Running tests on plugins

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

Plugins details

gzenc

Pad Templates:

SRC template: 'src' Availability: Always Capabilities: application/x-gzip

SINK template: 'sink' Availability: Always Capabilities: ANY

Element Properties:

  • 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)

gzdec

Pad Templates:

SINK template: 'sink' Availability: Always Capabilities: application/x-gzip

SRC template: 'src' Availability: Always Capabilities: ANY

Element Properties:

  • first-buffer-size : Size of first buffer (used to determine the mime type of the uncompressed data).
  • buffer-size : Buffer size.

Todo

Add support for deflate compressed format (RFC 1951)

Author

  • Alexandre Esse - Initial work - Snec

License

This project is licensed under the LGPL License - see the LICENSE file for details.

About

GStreamer plugin for gzip and zlib compression and decompression.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages