Hi,
Can anyone provide a C example of how to use the v4l2jpegdec element in gstreamer.
The jpeg image should be an "appsrc" - I have the jpeg image in memory and need to pass this into the v4l2jpegdec decoder.
The decoded image should be sent to an "appsink" element so I get the decoded image in memory.
Many thanks for any help,
Jonners.
v4l2jpegdec should be used in the imx8QM which is under preproduction, so I couldn't checked for you, if you have already have this, I suggest that you use "gst-inspect-1.0 v4l2jpegdec " to check the source code path, then you can find the source code, I think it should be included in the gst plugins
Hi Joan,
Many thanks for your response.
v4l2jpegdec is on my system ☺
What I am trying to achieve is to have a jpeg image in a buffer in my application (appsrc) and use the hardware decoder on the iMX8X to decode the jpeg into RGB raw data returned in a buffer to my application (appsink.)
I have this working using the “jpegdec” element – however, this is a software decoder and very slow (5 frames per second for a 1080p JPEG). If I replace the “jpegdec” element with “v4l2jpegdec” then I get the following error:
Elements created.
firmware version is 1.3.1
Error received from element mySrc: Internal data stream error.[VPU Decoder] error: don't find buffer when wait_rst_done is true, ctx->firmware_stopped=0fin=0
Debugging information: ../../../../git/libs/gst/base/gstbasesrc[VPU Decoder] error: don't find buffer when wait_rst_done is true, ctx->firmware_stopped=0fin=0
.c(3055): gst_base_src_loop (): /GstPipeline:myPipeline/GstAppSrc[VPU Decoder] error: don't find buffer when wait_rst_done is true, ctx->firmware_stopped=0fin=0
:mySrc:
streaming stopped, reason not-negotiated (-4)
I think this is positive as the VPU decoder has been initialise. I think my problem is that the jpeg image is not in the correct memory for the hardware decoder.
Is this something you might be able to help with?
Attached is a copy of my test application.
Kind regards,
Jonners.