HD videos cost lots of memory in Gstreamer

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

HD videos cost lots of memory in Gstreamer

6,031 次查看
neohong
Contributor I

Hi, community

I use the playbin of gstreamer to play a local video file(Video:1080p/mp4/size:446MB CMD:gst-launch playbin uri=file:///home/USB/xxx.mp4 ).


I find that used memory keeps increasing while playing the videos result in that other process cannot obtain enough memory.

And more ,I found someone has the same issue in community with me and they often take following measures :

echo 1 >/proc/sys/vm/drop_caches .

We have tried to clean the caches but it happed core dumped sometimes when play the same video .

How can We stipulate the size of memory for when gstreamer need a lot memory when playbin plays 1080p video smoothly?

※Environment:

CPU:  imx6d

DDR: 1024MB

Gstreamer Version:

gst1.0-fsl-plugins-4.0.2

gstreamer1.2.3

gst-plugins-base-1.2.3

标签 (4)
标记 (2)
0 项奖励
回复
4 回复数

5,705 次查看
joanxie
NXP TechSupport
NXP TechSupport

could you share the log file? when you play the video, how many hardware buffers has been allocated?

0 项奖励
回复

5,705 次查看
neohong
Contributor I

When the playbin changed to PAUSED  state,

imxv4l2 v4l2_core/gstimxv4l2.c:1493:gst_imx_v4l2_allocate_buffer: [00m Allocated v4l2buffer(0x7858f978), index(0), vaddr(0x56e32000), paddr(0x48800000), size(3112960).

imxv4l2 v4l2_core/gstimxv4l2.c:1493:gst_imx_v4l2_allocate_buffer: [00m Allocated v4l2buffer(0x785d4eb8), index(0), vaddr(0x56b3a000), paddr(0x48b00000), size(3112960).

============================================================

imxv4l2 v4l2_core/gstimxv4l2.c:1493:gst_imx_v4l2_allocate_buffer: [00m Allocated v4l2buffer(0x7858f9c4), index(1), vaddr(0x56842000), paddr(0x48e00000), size(3112960).

imxv4l2 v4l2_core/gstimxv4l2.c:1493:gst_imx_v4l2_allocate_buffer: [00m Allocated v4l2buffer(0x785d4f04), index(1), vaddr(0x5654a000), paddr(0x49100000), size(3112960).

============================================================

imxv4l2 v4l2_core/gstimxv4l2.c:1493:gst_imx_v4l2_allocate_buffer: [00m Allocated v4l2buffer(0x7858fa10), index(2), vaddr(0x56252000), paddr(0x49400000), size(3112960).

imxv4l2 v4l2_core/gstimxv4l2.c:1493:gst_imx_v4l2_allocate_buffer: [00m Allocated v4l2buffer(0x785d4f50), index(2), vaddr(0x55f5a000), paddr(0x49700000), size(3112960).

This is log file get by playing HD videos smoothly.

If media app occurred  core dumped  , not all buffer was not equal each other and may happened OOM.

Allocated v4l2buffer(0x784f4750), index(0), vaddr(0x5533d000), paddr(0x4f500000), size(3112960).

Allocated v4l2buffer(0x784f479c), index(1), vaddr(0x54f08000), paddr(0x4f800000), size(3112960).

Allocated v4l2buffer(0x784a0a4c), index(1), vaddr(0xffffffff), paddr(0xffffffff), size(3112960).

Allocated v4l2buffer(0x78946468), index(2), vaddr(0x58c94000), paddr(0x4ae80000), size(348160).

And I know liunx have control group system  to limit process source. Can I use this or latest DSP of FS include this ?

0 项奖励
回复

5,705 次查看
art
NXP Employee
NXP Employee

The better way is to migrate to the latest BSP by Freescale that has this problem mostly fixed.


Have a great day,
Artur

0 项奖励
回复

5,705 次查看
neohong
Contributor I

Thank you for you reply and I would like have a try.

On the other hand, I wonder how much memory imxv4l2sink consume ?

When the HD videos coming ,  gst_imx_v4l2_allocate_buffer()   mmap 3 buffers and each buffer cost memory about 0x2F8000 .(1kb=0x400H,1Mb=100000H)

About 2.9M*3=8.7Mb memory was used by imxv4l2sink.

Am I right  ? I hope you can give me how to count the memory correctly imxv4l2sink cost .

Thanks a lot .

0 项奖励
回复