<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 10, 2016 at 8:36 AM, Nirbheek Chauhan <span dir="ltr"><<a href="mailto:nirbheek.chauhan@gmail.com" target="_blank">nirbheek.chauhan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, May 10, 2016 at 4:51 PM, Aaron Boxer <<a href="mailto:boxerab@gmail.com">boxerab@gmail.com</a>> wrote:<br>
> Thanks, Sebastian and Nirbheek. I will test this out.<br>
> What is the simplest way of doing the following:<br>
><br>
> 1) passing a single TIFF image to gstreamer, and have it output a J2K<br>
> encoded image<br>
> 2) passing a single J2K image to gstreamer, and have it output a TIF image<br>
> (or PNG for example)<br>
><br>
<br>
</span>For TIFF, gstreamer has:<br>
One encoder: avenc_tiff (wrapper around libav)<br>
Two decoders: avdec_tiff (wrapper around libav) and gdkpixbuf (if you<br>
build gdk-pixbuf with the tiff pixbuf loader).<br>
<br>
For JPEG2000, the best encoder/decoder is openjpeg.<br>
<br>
For converting a file from tiff to jp2k, something like this should work:<br>
<br>
multifilesrc location=test.tiff num-buffers=1 caps=image/jp2 !<br>
avdec_tiff ! videoconvert ! openjpegenc ! 'image/jp2' ! filesink<br>
location=test.jp2<br>
<br>
Note that you need to specify which format you want for JPEG2000:<br>
'image/jp2' or 'image/x-jpc', etc.<br>
For converting jp2k to tiff, this should work:<br>
<br>
multifilesrc location=test.jp2 num-buffers=1 caps=image/jp2 !<br>
openjpegdec ! videoconvert ! avenc_tiff ! filesink location=test.tiff<br>
<br>
The reason why you need multifilesrc is because it allows you to<br>
specify the caps of the data which is needed by decoders that do not<br>
implement parsers (such as openjpegdec, avdec_tiff, etc). If you used<br>
something like pngdec you could use filesrc directly and the decoder<br>
would figure out the caps.<br></blockquote><div><br><br></div><div>Awesome, thanks for the detailed instructions.<br><br></div><div>Aaron<br></div><div><br> </div><div><br><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">_______________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br></div></div>