<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css><!-- DIV {margin:0px;} --></STYLE>

<META content="MSHTML 6.00.2800.1607" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008>Huques,</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008>I think there may be some methods.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008>1. not set queue size by frame number, but time of 
buffers.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008>2. change queue implementation to adapt to different 
codec ( not the best :) )</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008>3. use GstController to control property 
dynamically.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=ltr align=left><FONT face="Courier New" color=#0000ff><SPAN 
class=659384001-14032008>Maybe someone else has better 
methods.</SPAN></FONT></DIV>
<DIV><FONT face="Courier New" color=#0000ff></FONT>&nbsp;</DIV>
<DIV class=Section1><FONT face="Courier New" color=#0000ff></FONT>&nbsp;</DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
gstreamer-embedded-bounces@lists.sourceforge.net 
[mailto:gstreamer-embedded-bounces@lists.sourceforge.net] <B>On Behalf Of 
</B>Hugues Fruchet<BR><B>Sent:</B> Thursday, March 13, 2008 8:42 
PM<BR><B>To:</B> gstreamer-embedded@lists.sourceforge.net<BR><B>Subject:</B> 
[gst-embedded] Video playback: frames memory consumption 
tuning<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV 
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV>Using playbin to make a video playback will typically use this 
pipeline:</DIV>
<DIV>&lt;decoder&gt; ! queue ! &lt;sink&gt;</DIV>
<DIV>This&nbsp;make the&nbsp;decoding threading independent of the rendering 
threading, which is needed to let the rendering side synchronize on clock to 
display the frame of time N when the real time reach N, assuming that an amount 
of frames have been decoded by advance &amp; have been put in the queue.</DIV>
<DIV>Gstreamer assumes that if queue is full, the source is blocked till sink 
has consumed some frames, so when the queue is full, decoder thread is stopped 
till rendering side as consumed a frame.</DIV>
<DIV>The problem is that by default, queue has 200 frames, so if the decoder is 
fast enough to decode faster than framerate, the queue will goes up to 200 
frames !(in fact not because another 2s value limit the queue size).</DIV>
<DIV>By evidence, on embedded device, such a consumption is not acceptable, so 
we must tune the size of the queue.</DIV>
<DIV>The problem is that this tuning is at least codec-dependent 
(stream-dependent also):</DIV>
<DIV>1) MPEG4/H263</DIV>
<DIV>Decoding time is quite always the same for&nbsp;a given&nbsp;stream, so it 
is assumed that for a given fixed rendering framerate, decoder will never or 
rarely decode slower than framerate =&gt; small bufferization needed (2-3 
frames).</DIV>
<DIV>&nbsp;</DIV>
<DIV>2) H264</DIV>
<DIV>Decoding time has a big dispersion, some decoding "peaks" maybe there which 
makes a single decoding takes some framerate periods! =&gt; queue size must be 
larger (10-20 frames) to ensure bufferization. </DIV>
<DIV>This also depends on:</DIV>
<DIV>- video dimensions, complexity of video, because this will decrease the 
decoding duration,</DIV>
<DIV>- framerate, because if frame rate is low regarding decoding duration, no 
pbm</DIV>
<DIV>- DPB of SPS header ? size of bufferization needed inside decoder to output 
1 frame. Not sure if this must be care of.</DIV>
<DIV>=&gt; so stream dependent</DIV>
<DIV>&nbsp;</DIV>
<DIV>So we must be able to tune queue max-size-buffers=x, x depending on codec 
type (@ first approach) or stream infos (@second hand).</DIV>
<DIV>&nbsp;</DIV>
<DIV>So the question are:</DIV>
<DIV>- Is anybody knows if someting is there in playbin allowing this ?</DIV>
<DIV>- If playbin modifications must be made, which type of gst mechanism can we 
use to get what is the video codec type &amp; infos on video in order to tune 
the queue size ?</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></DIV><BR>
<HR SIZE=1>
Envoyé avec <A 
href="http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52423/*http://fr.docs.yahoo.com/mail/overview/index.html">Yahoo! 
Mail</A>.<BR>Une boite mail plus intelligente. </A></BODY></HTML>