Memory leak when gstreamer playing RTSP with libgstvpu

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

Memory leak when gstreamer playing RTSP with libgstvpu

13,473 Views
jiaxingliang
Contributor I

Command:

gst-launch-1.0 playbin uri=rtsp://192.168.1.88:556/vga

The memory of gst-launch-1.0 will increase more than 30M every hour, then the video stop, but audio soud ok。

 Delete the libgstvpu.so , use the same commad. memory will not increase,  but play the high resolution (1920x1080) not smooth.

Anybody  has faced the same problem and resolved? Please help

karinavalencia

I do more test.

Compare playing local video file and RTSP:

1)  play 1920x1080 (MPEG4\AVC_H_L3local files, that seems not has memory leak.  (log file : gplay-test-AVC_H_L3_Schindlers.log、gplay-test-MPEG4_Schindlers.log)

2) play 1920x1080 (AVC_H) RTSP, memory increase about 16M. (log file: gplay-test-AVC_H_RTSP.log)

Compare playing RTSP(960x540 AVC_H)  with vpudec and avdec_h264 lib:

a) use vpudec , memory increase about 10M in 20 mins.( log file: gplay-test-AVC_H_RTSP_with_VPU.log)

b) use avdec_h264(delete /usr/lib/gstreamer-1.0/libgstvpu.so) , memory not increase. (log file: gplay-test-AVC_H_RTSP_with_avdec_h264.log)

 

CPU: IMX6DL

Kernel: 4.1.15

BSP: 2.0.1 GA

vpudec: imx-gst1.0-plugin-4.1.4

avdec_h264:gst-libav-1.8.1

Labels (1)
0 Kudos
46 Replies

2,496 Views
jiaxingliang
Contributor I

Please check the log RTSP_memory_2019-05-27.rar and RTSP_memory_2019-05-28.rar in the first floor.

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Can you show us some h264parse and vpu log after applying the "Set-min_frame_size-of-h264parse-to-10.patch"?

Just input debug command line "export GST_DEBUG=h264parse:6,vpu_dec_object:6" on board first, then start to play the rtsp stream.

Ten minites' log is enough and we will check whether the patch works in your side.

0 Kudos

2,496 Views
jiaxingliang
Contributor I

You can find thelog “h264parse gsth264parse.c:274:gst_h264_parse_start:<h264parse0> LJX set min frame size to 10” in xxx_play..log

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Please help to get more log with "export GST_DEBUG=h264parse:6,vpu_dec_object:6", in our side, there is no memory leak now.

0 Kudos

2,496 Views
jiaxingliang
Contributor I

It is very slow with debug mode , you can check about the log "play_log_with_debug.rar  in the first floor" has any useful info.

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

With play_log_with_debug.rar from you after applying the patch, h264parse receive the same 9bytes frame(type=SEI, size=5) for every 15 frames. It is now pushed downstream with the next IDR frame as what patch expected. Then vpu decode each frame it received and list length of frames won't increase.

"[05-28-15:00:25.072]0:01:37.288456012  7033   0x790120 DEBUG              h264parse gsth264parse.c:717:gst_h264_parse_process_nal:<h264parse0> processing nal of type 6 SEI, size 5"

With RTSP_memory_2019-05-27.rar from you, memory usage of gplay-1.0 is almost stable from 19:00-22:00 at 427M, but increase at 17:00-19:00 from 378M to 427M.

In our side, with the patch, vpu can decode each frame it received and send out the same as you. The memory usage of gst-launch-1.0/gplay-1.0 is 21256 after 1 minute's play. Attached memory-record.log

0 Kudos

2,496 Views
jiaxingliang
Contributor I

HI, Qiang:  

       But why my video will still pause for a long time.

What is the resolution  of rtsp://192.168.1.98:8554/vga now?  If the resolution is litte , the memory will not increase.  My hdmi encoder output resolution is 1920x1080.

pastedImage_1.png

pastedImage_2.png

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

From our debug, the memory leak issue is same for 720P and 1080P. Your log is not aligned with our side, it increased at first two houres, then keep there for followed three houres.

And our log always show the same memory size. Maybe you can also try with 720P.

0 Kudos

2,496 Views
jiaxingliang
Contributor I

The memory will not increase when up to 400m+, but the video will  pause about 3mins, then continue to play. 

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

Is there special log for such pause?

0 Kudos

2,496 Views
jiaxingliang
Contributor I

李总,这个问题有进展吗? 客户再一次追问了

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

没有在看了,需要你们抓些log看看。

0 Kudos

2,496 Views
jiaxingliang
Contributor I

需要我这边提供什么log呢? 

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

We tested on Linux_IMX_4.14.78-1.0.0_GA BSP with attached patch.

There is no stop issue found.

0 Kudos

2,496 Views
jiaxingliang
Contributor I

I just use "export GST_DEBUG=*:1", so there nothing debug log. if I use  "export GST_DEBUG=h264parse:6,vpu_dec_object:6",  it is very slow.

0 Kudos

2,496 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

no fix yet.

0 Kudos

2,506 Views
jiaxingliang
Contributor I

HI,Li:

      The memory still increase. 

pastedImage_2.png

pastedImage_3.png

and the video will pause for a while  untill got the message:

pastedImage_4.png

0 Kudos

2,506 Views
qiang_li-mpu_se
NXP Employee
NXP Employee

No update yet.

0 Kudos

2,506 Views
jiaxingliang
Contributor I

karinavalencia

Qiang_FSL

I found the memory increase immediately when play with http scream if show this log "gst_base_sink_is_too_late:<overlaysink0> warning: A lot of buffers are being dropped."

Was this problem  cause when vpudec fail not but free the memory about frame? 

I'm not familiar with vpudec follow,  please give me some advice.

Wait for your reply.

0 Kudos

2,506 Views
karina_valencia
NXP Apps Support
NXP Apps Support

b36401‌, can you continue with the follow up here?

0 Kudos

2,506 Views
jiaxingliang
Contributor I

thanks for reply, but this problem is still there.

b36401‌ please give more help.   

The problem is urgent,  because this product has been mass-produced for more than 1 years.

CPU: IMX6DL

Kernel: 4.1.15

BSP: 2.0.1 GA

GST: imx-gst1.0-plugin-4.1.4

0 Kudos