HW accelerated jpeg decoding with gstreamer on imx8mp

Is there a gstreamer plugin for hardware accelerated jpeg decoding on the i.MX 8M Plus Verdin board?

We have a webcam delivering jpeg images, encode them as h264 (or other) and send them over the network. With the current pipeline, it looks like the jpeg decoding takes most of the CPU (about 34%).

The question is, what plugin can replace jpegdec in our gstreamer pipeline:
gst-launch-1.0 v4l2src device=/dev/video2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegdec ! vpuenc_h264 ! rtph264pay ! udpsink host=192.168.1.29 port=12345

So far I haven’t found an alternative and got mixed information if that is even possible.

Tested on a recent multimedia image and self built Yocto image based on Torizon.

tdx-info:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.84-7.3.0-devel #1 SMP PREEMPT Thu May 15 08:34:55 UTC 2025
Kernel command line:      root=PARTUUID=8d7089f6-02 ro rootwait console=tty1 console=ttymxc2,115200
Distro name:              NAME="TDX Wayland with XWayland"
Distro version:           VERSION_ID=7.3.0-devel-20250516-build.338
Distro variant:           -
Hostname:                 verdin-imx8mp-15288758
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1B
Serial number:            15288758
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for your detailed question and for including your pipeline and system info.

Currently, there is no specific GStreamer plugin for hardware-accelerated JPEG decoding on the Verdin iMX8M Plus. The NXP i.MX 8M Plus SoC offers hardware acceleration primarily for video codecs such as H.264, H.265, and VP8/9, but JPEG hardware decoding is not exposed via a GStreamer element as it is for video codecs.

In your pipeline:

gst-launch-1.0 v4l2src device=/dev/video2 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegdec ! vpuenc_h264 ! rtph264pay ! udpsink host=192.168.1.29 port=12345

jpegdec is a software decoder, and unfortunately, there is no hardware-accelerated replacement currently available for it on this platform.

You are already using hardware-accelerated encoding with vpuenc_h264 (Documentation), but for JPEG decoding, the pipeline will remain CPU-bound with jpegdec.

Possible Optimizations or Alternatives

  • Lower JPEG Quality from Source: If you can control the webcam, lowering the JPEG quality may reduce CPU usage, but with image quality trade-offs.
  • Downscale Before Decoding: If resolution is not critical, capturing at a lower resolution will reduce the CPU load.
  • Check for Vendor Updates: Keep an eye on software updates from NXP or Toradex, as future releases may introduce new hardware-accelerated plugins or kernel features.
  • Alternative Pipelines: Some webcams support MJPEG or even H.264 output directly; if your device supports it, encoding directly from a raw stream without JPEG may be possible, bypassing the CPU-heavy step.

If you have additional questions regarding GStreamer on this platform or need help tuning your pipeline, feel free to ask!

Best regards,
Toradex AI Assistant.

Verdin iMX8M Plus Hardware Info
GStreamer Video Processing Documentation

It is quite disappointing to not have a hardware accelerated jpeg decoder on a platform that:

is strong on video en/decoding
I expect has the hardware to do it

Are there any plans to implement it?
@ToradexAI

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Thank you for your feedback and for sharing your expectations.

At present, there is no available information or public roadmap regarding the implementation of hardware-accelerated JPEG decoding on the Verdin iMX8M Plus. While the module features powerful video acceleration hardware and supports codecs such as H.264 and H.265 via GStreamer plugins, JPEG decoding remains a software-only process with the current software and board support packages.

If a hardware-accelerated JPEG decoder is introduced in future BSP or driver releases, updates will typically appear in the official documentation. For now, the recommended GStreamer element for JPEG decoding remains jpegdec, which is CPU-based.

Here are relevant resources for monitoring potential software improvements:

If you have any more technical questions or need help with optimization strategies on the current platform, feel free to ask.

Best regards,
Toradex AI Assistant.