What is the recommended library for doing JPEG2000 encoding and decoding on Jetson Nano? It seems nvJPEG2000 only works on x86_64 CPU not ARM processor. Thank you!
You may try: with gstreamer:
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=I420 ! openjpegenc ! image/x-jpc ! jpeg2000parse ! openjpegdec ! xvimagesink
# Or
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=I420 ! openjpegenc ! image/x-j2c ! jpeg2000parse ! openjpegdec ! xvimagesink
Thank you. Just to confirm, this works on a single image too, is that correct?
1 Like
I don’t have experience with single picture encoding into JPEG2000, but the following seems working for reading a PNG picture from file, decoding, then encoding into JPC and saving to file:
gst-launch-1.0 -v filesrc location=test.png ! image/png,width=1720,height=1440 ! pngdec ! video/x-raw,framerate=0/1 ! videoconvert ! openjpegenc ! image/x-jpc ! filesink location=out.jp2
# mediainfo shows correct info
mediainfo out.jp2
General
Complete name : out.jp2
Format : JPEG 2000
File size : 2.20 MiB
Image
Format : JPEG 2000
Format profile : No restrictions
Width : 1 720 pixels
Height : 1 440 pixels
Chroma subsampling : 4:4:4:4
Bit depth : 8 bits
Compression mode : Lossless
Stream size : 2.20 MiB (100%)
# Or using FFMPEG encoder:
gst-launch-1.0 filesrc location= test.png ! image/png,width=1720,height=1440 ! pngdec ! video/x-raw,framerate=0/1 ! videoconvert ! avenc_jpeg2000 ! image/x-j2c ! filesink location=out.jp2
mediainfo out.jp2
General
Complete name : out.jp2
Format : JPEG 2000
Format profile : MPEG-4
Codec ID : jp2 (jp2 )
File size : 2.20 MiB
Image
Format : JPEG 2000
Format profile : No restrictions
Width : 1 720 pixels
Height : 1 440 pixels
Color space : RGB
Chroma subsampling : 4:4:4
Bit depth : 8 bits
# Display with gstreamer:
gst-play-1.0 --wait-on-eos out.jp2
Great. Thank you!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.