I am working on a real-time video processing application using OpenCV and GStreamer. My current GStreamer pipeline is hitting a performance bottleneck, and I suspect the software-based JPEG decoding is the primary cause, preventing me from achieving the camera’s maximum frame rate of 120 FPS.
My GStreamer pipeline is as follows:
v4l2src device=/dev/video99 io-mode=4 extra-controls=“c,gamma=100,gain=0,auto_exposure=3” ! image/jpeg, width=1280, height=720, framerate=120/1 ! queue max-size-buffers=1 leaky=downstream ! jpegdec ! videocrop top=100 left=100 right=100 bottom=100 ! videoconvert ! video/x-raw,format=GRAY8 ! appsink max-buffers=1 drop=true sync=false
I have attempted to integrate i.MX specific GStreamer plugins into my Docker container by following How do I integrate IMX specific plugins for gstreamer in a docker container? - #13 by allan.tx . While I was able to successfully install v4l2h264dec, v4l2h265dec, and imxvideoconvert_g2d, I have not been able to install a hardware-accelerated equivalent for the jpegdec element.
Camera specs:
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture
[0]: 'MJPG' (Motion-JPEG, compressed)
Size: Discrete 1280x800
Interval: Discrete 0.008s (120.000 fps)
Interval: Discrete 0.010s (100.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.008s (120.000 fps)
Size: Discrete 800x600
Interval: Discrete 0.008s (120.000 fps)
Interval: Discrete 0.010s (100.000 fps)
Size: Discrete 640x480
Interval: Discrete 0.008s (120.000 fps)
Interval: Discrete 0.010s (100.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.008s (120.000 fps)
Interval: Discrete 0.010s (100.000 fps)
[1]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 1280x800
Interval: Discrete 0.100s (10.000 fps)
Size: Discrete 1280x720
Interval: Discrete 0.100s (10.000 fps)