OpenJPEG Plugin

Nirbheek Chauhan nirbheek.chauhan at gmail.com
Tue May 10 12:36:55 UTC 2016


On Tue, May 10, 2016 at 4:51 PM, Aaron Boxer <boxerab at gmail.com> wrote:
> Thanks, Sebastian and Nirbheek. I will test this out.
> What is the simplest way of doing the following:
>
> 1) passing a single TIFF image to gstreamer, and have it output a J2K
> encoded image
> 2) passing a single J2K image to gstreamer, and have it output a TIF image
> (or PNG for example)
>

For TIFF, gstreamer has:
One encoder: avenc_tiff (wrapper around libav)
Two decoders: avdec_tiff (wrapper around libav) and gdkpixbuf (if you
build gdk-pixbuf with the tiff pixbuf loader).

For JPEG2000, the best encoder/decoder is openjpeg.

For converting a file from tiff to jp2k, something like this should work:

multifilesrc location=test.tiff num-buffers=1 caps=image/jp2 !
avdec_tiff ! videoconvert ! openjpegenc ! 'image/jp2' ! filesink
location=test.jp2

Note that you need to specify which format you want for JPEG2000:
'image/jp2' or 'image/x-jpc', etc.
For converting jp2k to tiff, this should work:

multifilesrc location=test.jp2 num-buffers=1 caps=image/jp2 !
openjpegdec ! videoconvert ! avenc_tiff ! filesink location=test.tiff

The reason why you need multifilesrc is because it allows you to
specify the caps of the data which is needed by decoders that do not
implement parsers (such as openjpegdec, avdec_tiff, etc). If you used
something like pngdec you could use filesrc directly and the decoder
would figure out the caps.

-- 
~Nirbheek Chauhan


More information about the gstreamer-devel mailing list