Hi all,
I used the following command to test customer's IP cameras and found that the memory usage increases overtime.
gst-launch-1.0 rtspsrc latency=20 location="rtsp://192.168.2.111:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream" ! rtph264depay ! h264parse ! vpudec ! waylandsink window-width=380 window-height=164
Please note that, if I replace "vpudec" with "avdec_h264", the memory usage is stable.
gst-launch-1.0 rtspsrc latency=20 location="rtsp://192.168.2.111:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream" ! rtph264depay ! h264parse ! avdec_h264 ! waylandsink window-width=380 window-height=164
Could someone guide me to solve the issue?
NOTE:
I already tested on following Yocto BSP version. All of them have the same problem.
imx_4.14.98_2.3.0
imx_5.4.70_2.3.0
imx_5.10.35_2.0.0
Thanks in advance,
Brian
how about using this patch?
--- a/plugins/vpu/gstvpu.h +++ b/plugins/vpu/gstvpu.h @@ -45,7 +45,7 @@ static VPUMapper vpu_mappers[] = { {VPU_V_VP9, "video/x-vp9"}, {VPU_V_VP8, "video/x-vp8"}, {VPU_V_VP6, "video/x-vp6-flash"}, - {VPU_V_AVC, "video/x-h264"}, + {VPU_V_AVC, "video/x-h264,alignment=au"}, {VPU_V_MPEG2, "video/mpeg, systemstream=(boolean)false, mpegversion=(int){1,2}"}, {VPU_V_MPEG4, "video/mpeg, mpegversion=(int)4"}, {VPU_V_H263, "video/x-h263"}, --
Hi Joanxie,
Thanks for your response. I already tried the patch in the past (found in other discussion). The issue still present.
In the past two weeks, I tried to add some debug messages in gstreamer's vpudec plugin and vpu library. And tried to find out the different between the good camera and bad camera (bad means it has memory leak).
Finally, I found the problem is caused by the frame which contains only one SEI NAL. However, I still don't find out the root cause. (The good camera send one frame which contains both SEI and IDR NAL.)
Current workaround is modify h264parse plugin to drop SEI NAL message, but I am not sure whether there is any impact for other H264 stream.
I think we should modify vpudec plugin instead of h264parse plugin to handle this case correctly (just like avdec_h264 plugin).
Brian
Hello Brian @brianwu ,
It's been a while but I believe we ran into this or a similar problem (some camera h264 ts leading to huge 20MB/minute leak with vpudec only).
This still happens on the latest 5.15.71_2.2.0 BSP, have you been able to reach some form of resolution?
Thanks,
Dominique
I already sent to you private message, pls try that again