Is there are example of reading a png/jpeg/tiff file and converting to a EGLImageKHR, then doing processing and then saving as a png/jpeg/tiff file? Thanks in advance.
Hi,
There is no standalone sample for this. You may refer to the samples:
/usr/src/jetson_multimedia_api/samples/05_jpeg_encode
/usr/src/jetson_multimedia_api/samples/06_jpeg_decode
/usr/src/jetson_multimedia_api/samples/12_v4l2_camera_cuda
05 and 06 samples demonstrate decoding JPEG into NvBufSurface and encode NvBufSurface to JPEG. cuda_postprocess() in 12 sample demonstrate mapping NvBufSurface into EGLImage. You may refer to the sample and implement the use-case.
Hardware acceleration for decoding PNG and TIFF is not supported. For the use-cases, would need other users to share experience.
Is EGLImage same as EGLImageKHR, if not work other conversion needs to be done? Thanks in advance.
When going from jpg to nvbufsurface and back to jpg the colors don’t match!? Is there a step missing that for the decode the image file must be a very specific format. After I did a conversion using convert I got:
General
Complete name : CubedPro8KLocalSmartBox-1920x1080-converted.jpg
Format : JPEG
File size : 101 KiB
Image
Format : JPEG
Width : 1 920 pixels
Height : 1 280 pixels
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Compression mode : Lossy
Stream size : 101 KiB (100%)
ColorSpace_ICC : RGB
This is the input file that I then used with the decode app. Is there something wrong with the above format? Thanks.
Also looks like the planes are not longer over lapping, appears some no longer match the original width height.
Here is the before and after files.
File CubedPro8KLocalSmartBox-1920x1080-converted.jpg was the input to the decoder and CubedPro8KLocalSmartBox-1920x1080-converted-to-nvbuf-to-jpg was the output of the encoder. As you can see they don’t match.
Just to be clear, I’m sending in YUV to decode and getting YUV back from encode. But then I need to convert to encoded result back to RGB and don’t see a way to to that looking at the examples.
Yes. Please grep EGLImageKHR under /usr/src/jetson_multimedia_api and you can see related code.
Hardware JPEG encoder does not support RGB. Please use software encoder if you would like to encode RGB data.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.