<div dir="ltr"><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><a name="_MailAutoSig"><span lang="EN-IN">Hi,</span></a></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">I want to use the following gstreamer
pipeline for multiple IP cameras as an infinite process to keep the video
buffer of a fixed duration always.</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Below is a sample pipeline I am using:</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN" style="font-family:"Courier New"">gst-launch-1.0  -e rtspsrc location="rtsp://<user>:<password>@<IP_ADDR>:554/cam/realmonitor?channel=1&subtype=0"
name = d \</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN" style="font-family:"Courier New""> ! 
rtph264depay ! h264parse  !
splitmuxsink name = mux location=a_video%02d.mp4 max-size-bytes=5000000
max-size-time=2000000000 max-files=5</span></p>



<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">But when I run this pipeline for 4 IP
cameras  on the actual target (<a href="https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/i.mx-applications-processors/i.mx-6-processors/i.mx-6ultralite-processor-low-power-secure-arm-cortex-a7-core:i.MX6UL?tab=Design_Tools_Tab" style="color:rgb(5,99,193)">iMX6UL</a>)
I am facing an excessive memory usage where ultimately the OOM_Killer will be started
and one of the application gets killed.</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">I have tried the same scenario on two three
other setups below are the observations:</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<ol style="margin-top:0in;margin-bottom:0in" start="1" type="1">
 <li class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b><span lang="EN-IN">iMX6UL – 696 MHz</span></b><b><span lang="EN-IN" style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(74,74,77);background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"> - </span><span lang="EN-IN"> 512MB RAM</span></b><span lang="EN-IN"> - Custom Built using Yocto (<a href="https://source.codeaurora.org/external/imx/imx-manifest/tree/?h=imx-linux-rocko" style="color:rgb(5,99,193)">imx-linux-rocko</a>)
     – gstreamer 1.14.2</span></li>
</ol>

<p class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt 0.5in;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Ran the 4 pipelines. RAM’s used
memory kept growing rapidly, and within 15 minutes OOM_Killer task has killed
few processes.</span></p>

<p class="MsoNormal" style="text-indent:0.5in;margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Also observed that
some segment files generated by splitmuxsink are growing upto 80MB at times.
This should ideally not cross more than 5MB (max-size-bytes = 5000000 and
max-size-time=2000000000)</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<ol style="margin-top:0in;margin-bottom:0in" start="2" type="1">
 <li class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b><span lang="EN-IN">Raspberry Pi3(Model B)
     – 1.2 GHz - 1GB RAM</span></b><span lang="EN-IN"> - Custom Built using Yocto
     (<a href="https://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/tree/recipes-core/images/rpi-basic-image.bb" style="color:rgb(5,99,193)">/meta-raspberrypi/tree/recipes-core/images/rpi-basic-image.bb</a>)
     - gstreamer 1.14.2</span></li>
</ol>

<p class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt 0.5in;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Ran the 4 pipelines. RAM’s used
memory kept growing rapidly to 600 MB within 30 minutes, didn’t wait till
OOM_Killer to start. Manually stopped the processes.</span></p>

<p class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt 0.5in;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<ol style="margin-top:0in;margin-bottom:0in" start="3" type="1">
 <li class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b><span lang="EN-IN">x86 – Intel Xeon - 6GB
     RAM - Ubuntu 18.04</span></b><span lang="EN-IN"> – gstreamer 1.14.1 (pre-built)</span></li>
</ol>

<p class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt 0.5in;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Ran the 4 pipelines for about 6
hours. Consistent RAM of 96MB used memory for these pipelines. No OOM_Kill
situation occurred</span></p>

<p class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt 0.5in;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<ol style="margin-top:0in;margin-bottom:0in" start="4" type="1">
 <li class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b><span lang="EN-IN">Raspberry Pi3(Model B)
     – 1.2 GHz - 1GB RAM - debian</span></b><span lang="EN-IN"> – gstreamer 1.10.x
     (pre-built)</span></li>
</ol>

<p class="gmail-MsoListParagraph" style="margin:0in 0in 0.0001pt 0.5in;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Ran the 4 pipelines for about 1 hour.
Consistent RAM of 96MB used memory. No OOM_Kill situation occurred</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"> </span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">From these observations it looks like some additional
settings related to Memory management needs to be done to use the memory
efficiently.  Cases 3 and 4 show that
processes actually doesn’t need more than 100MB of memory but somehow the memory
is being used excessively in cases 1 and 2. Any idea what settings will prevent
this situation?</span></p>

<p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">I have tried GST_DEBUG with TRACE but unable
to deduce anything the flood of debug messages. Is there a better way to debug only
the buffers flowing in and out of splimuxsink?</span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN"><br></span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Thanks</span></p><p class="MsoNormal" style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span lang="EN-IN">Tarun</span></p></div>