[iMX8MM] Memory usage increases overtime while decoding some H.264 RTSP stream by Gstreamer's vpudec

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[iMX8MM] Memory usage increases overtime while decoding some H.264 RTSP stream by Gstreamer's vpudec

1,844件の閲覧回数
brianwu
Contributor III

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

ラベル(3)
0 件の賞賛
返信
4 返答(返信)

1,788件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

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"},
-- 
0 件の賞賛
返信

1,782件の閲覧回数
brianwu
Contributor III

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

0 件の賞賛
返信

1,336件の閲覧回数
martinetd
Contributor IV

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

0 件の賞賛
返信

1,632件の閲覧回数
joanxie
NXP TechSupport
NXP TechSupport

I already sent to you private message, pls try that again

 

0 件の賞賛
返信