<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I've noticed some interesting behaviour when playing back h.264 files. On systems with just a few cores (4-6), memory use is high, but reasonable (400-500 mb for 4k video), but on newer systems with 8-12 cores and hyperthreading enabled,
 we're seeing very high memory use (1.4 GB) which eventually leads to a memory allocation excpetion in glib (likely due to memory fragmentation).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The symptom can be replicated in gst-launch by varying the max-threads of avdec_h264:<o:p></o:p></p>
<p class="MsoNormal">gst-launch-1.0.exe filesrc location=c:/test.mp4 ! qtdemux ! h264parse ! avdec_h264 max-threads=6 ! autovideosink<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">For each additional thread we're seeing additional memory allocated to gst-launch.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, we'd like to continue using playbin (instead of that pipeline above) to more easily support more types of video.
<b>Is there a way to limit the number of threads and/or memory used by avdec_h264 through playbin</b>?
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Here's a quick overview of our systems:<o:p></o:p></p>
<p class="MsoNormal">Gstreamer 1.6.0<o:p></o:p></p>
<p class="MsoNormal">Windows 7<o:p></o:p></p>
<p class="MsoNormal">Xeon Processors - 6-12 cores, some with hyperthreading enabled<o:p></o:p></p>
<p class="MsoNormal">12-16GB ram<o:p></o:p></p>
<p class="MsoNormal">playbin -> appsink -> custom openGL shader pipeline<o:p></o:p></p>
<p class="MsoNormal">720p - 4k video, usually h.264, sometimes prores or other formats<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;background:white">Gordon Nickel</span></b><span style="font-size:10.5pt;color:black"><br>
</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;background:white">Lead Developer</span><span style="font-size:10.5pt;color:black"><br>
<br>
</span><b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;background:white">downstream</span></b><span style="font-size:10.5pt;color:black"><br>
</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;background:white">1624 NW Johnson Street</span><span style="font-size:10.5pt;color:black"><br>
</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;background:white">Portland, OR 97209, USA</span><span style="font-size:10.5pt;color:black"><br>
<br>
</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;background:white">503.226.1944 main</span><span style="font-size:10.5pt;color:black"><br>
</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black;background:white">503.226.1283 fax</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>