imx8mm mjpeg gstreamer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx8mm mjpeg gstreamer

1,522 Views
santhosh2
Contributor IV

Hi,

I am using the below gstreamer command for our custom camera, for MJPEG i have set for 30fps but only two frames are getting received every second,how to resolve this

Transmitter cmd

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1920,height=1080,framerate=30/1',tune=zerolatency, bitrate=500, speed-preset=superfast ! jpegenc ! rtpjpegpay name=pay0 pt=26 ! multiudpsink auto-multicast=true send-duplicates = true bind-port=5000 clients="255.255.255.255:5000"

Receiver Cmd

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp, encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! videoconvert ! fpsdisplaysink sync=true -v

Gstreamer Log

/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 16, dropped: 1, current: 2.00, average: 1.99
ERROR: from element /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:fps-display-video_sink/GstXvImageSink:fps-display-video_sink-actual-sink-xvimage: Output window was closed

0 Kudos
Reply
4 Replies

1,513 Views
igorpadykov
NXP Employee
NXP Employee

Hi santhosh2

 

seems mjpeg is not supported by i.MX8M Mini vpu as described in  Chapter 15
Video Processing Unit (VPU)

i.MX 8M Mini Applications Processor Reference Manual

so performance may be low.

 

Best regards
igor

0 Kudos
Reply

1,510 Views
santhosh2
Contributor IV
Spoiler
Thanks for the quick reply..

Is there any other way via gstreamer encoder we can increase the fps received ?

Regards,
Santhosh Kumar S
0 Kudos
Reply

1,506 Views
igorpadykov
NXP Employee
NXP Employee

I am afraid without support in hardware it is not possible to have

good fps figures.

 

Best regards
igor

0 Kudos
Reply

1,502 Views
santhosh2
Contributor IV

Hi Igor,

I have down below modifications  i was able to improve from 1fps to 20fps on the network (Below is the log )and i am trying to achieve 30fps  is there any other settings that we can tweek to achieve it?

1. Add the below line in mx6s_capture.c

//#define MAX_VIDEO_MEM 64
#define MAX_VIDEO_MEM 64*10 //64 Added by santhosh

2. add dma-coherent; in fsl-imx8mm.dtsi

csi1_bridge: csi1_bridge@32e20000 {
compatible = "fsl,imx8mm-csi", "fsl,imx8mq-csi", "fsl,imx6s-csi";
reg = <0x0 0x32e20000 0x0 0x10000>;
interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk IMX8MM_CLK_DISP_AXI_ROOT>,
<&clk IMX8MM_CLK_CSI1_ROOT>,
<&clk IMX8MM_CLK_DISP_APB_ROOT>;
clock-names = "disp-axi", "csi_mclk", "disp_dcic";
power-domains = <&dispmix_pd>;
dma-coherent; /*Added by santhosh*/
status = "disabled";
};

mipi_csi_1: mipi_csi@32e30000 {
compatible = "fsl,imx8mm-mipi-csi";
reg = <0x0 0x32e30000 0x0 0x1000>;
interrupts = <GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <333000000>;
clocks = <&clk IMX8MM_CLK_CSI1_CORE_DIV>,
<&clk IMX8MM_CLK_CSI1_PHY_REF_DIV>,
<&clk IMX8MM_CLK_DISP_AXI_ROOT>,
<&clk IMX8MM_CLK_DISP_APB_ROOT>;
clock-names = "mipi_clk", "phy_clk", "disp_axi", "disp_apb";
bus-width = <4>;
csi-gpr = <&dispmix_gpr>;
power-domains = <&mipi_pd>;
/*JPEG lateancy issue is solved using below link*/
/*https://community.nxp.com/t5/i-MX-Processors/i-MX8M-EVK-MIPI-CSI-Camera-Frame-Rate/m-p/725043?commen...
/*https://community.nxp.com/t5/i-MX-Processors/Gstreamer-dropping-frames-opencv-videocapture/m-p/10119...
dma-coherent; /*Added by santhosh*/
status = "disabled";
};
3. Enlarge GST_V4L2_MIN_BUFFERS in the following file from 2 to 7
/gstreamer1.0-plugins-good/1.12.2-r0/git/sys/v4l2/gstv4l2object.h :

or in
imx-yocto-bsp/bld-xwayland/tmp/work/aarch64-mx8mm-poky-linux/gstreamer1.0-plugins-good/1.14.0.imx-r0/git/sys/v4l2
#define GST_V4L2_MIN_BUFFERS 7

------------------------------------------------------------------------------------------------------------------------

Log:

GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 556, dropped: 0, current: 21.04, average: 20.81
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 567, dropped: 0, current: 20.84, average: 20.81

0 Kudos
Reply