NvJPEGDecoder and Encoder, MPO file format error

Hi everyone,
I am trying to decode and encode a JPG file. Even though, the extension is .JPG, image format is MPO. I verified that with both decoder sample code and Pillow of the Python. When I try to decode this image I am getting MPO Decode Error(I am decoding it to buffer not fd). Then I enabled MJpegDecode and try to encode it with the sample code. However, there is a shift in my image. Some portion from the top is looking normal but then shift is started. I am attaching the encoded image.
I would like to use this decoder-encoder pair due to time complexity of the image reading. OpenCV reads it in 1s, but I need less than that. Another thing is if I read the image with OpenCV and save it, I can process the saved image with decoder and encoder samples.
Is there anything to solve this issue or decoding-encoding MPO images?
Thanks in advance.

Hi,
The hardware capability is described in

Jetson Download Center | NVIDIA Developer
Jetson AGX Orin Series Data Sheet (Including AGX Orin Industrial)

And you may try the samples:

/usr/src/jetson_multimedia_api/samples/05_jpeg_encode/
/usr/src/jetson_multimedia_api/samples/06_jpeg_decode

By default JPG is supported. For this use-case, you may need to implement demuxing MPO into JPGs for JPEG decoding. And mux encoded JPGs into MPO.