JPEG Parameter Struct Mismatch When Using jpegenc on Jetson AGX Orin

I am experiencing a JPEG parameter struct mismatch error when trying to encode images using jpegenc in GStreamer on my Jetson AGX Orin. The error occurs when capturing frames from a GMSL2-connected camera using the following GStreamer pipeline:

gst-launch-1.0 v4l2src io-mode=2 device=/dev/video0 do-timestamp=false ! \
    "video/x-raw, width=2880, height=1860, format=UYVY" ! \
    jpegenc quality=50 ! fpsdisplaysink video-sink=fakesink sync=false

Output

JPEG parameter struct mismatch: library thinks size is 720, caller expects 584

Library dependencies (lddoutput)

ldd $(which gst-launch-1.0) | grep jpeg
    /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so (0x0000ffff92cd8000)

System Information

  • Jetson Model: Jetson AGX Orin
  • Camera Interface: GMSL2
  • GStreamer Version: (please specify your GStreamer version using gst-launch-1.0 --version)
  • L4T Version: 35.4.1 (Output from dpkg -l | grep nvidia-l4t-core)

Troubleshooting Attempts

  1. Checked linked libraries using ldd, and it shows libnvjpeg.so as the linked JPEG library.
  2. Tried nvjpegenc instead of jpegenc, but nvjpegenc does not support the UYVY format directly.
  3. Reinstalled libjpeg-turbo8 and libjpeg-turbo8-dev, but the issue persists.
  4. Tested with different resolutions and formats, but the error remains.
  5. Checked for mixed linking to libjpeg.so and libnvjpeg.so, and only libnvjpeg.so appears linked.

Questions

  • Could this issue be caused by a mismatch between jpegenc and libnvjpeg.so?
  • Should I force jpegenc to use libjpeg.so instead of libnvjpeg.so?
  • Is there a recommended way to encode UYVY → JPEG on Jetson AGX Orin without nvvidconv? (nvvidconv halves my FPS)
  • Are there any known issues with jpegenc on Jetson Orin?

Thanks for the help!

Hi,

For the camera basic functionality first needs to check the device and driver configuration.
You can reference to below program guide for the detailed information of device tree and driver implementation.
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html?highlight=programing#sensor-software-driver-programming

Please refer to Applications Using V4L2 IOCTL Directly by using V4L2 IOCTL to verify basic camera functionality.
https://docs.nvidia.com/jetson/archives/r36.3/DeveloperGuide/SD/CameraDevelopment/SensorSoftwareDriverProgramming.html?highlight=programing#to-run-a-v4l2-ctl-test

Once confirm the configure and still failed below link help to get log and some information and some tips for debug.
https://elinux.org/Jetson/l4t/Camera_BringUp#Steps_to_enable_more_debug_messages

Thanks!

To solve the mismatch issue.
Could you execute below commands and test weather the issue exist?

export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/nvidia/libnvjpeg.so

Thanks