<?xml version="1.0" encoding="iso-8859-1"?>
<rdf:RDF xmlns="http://purl.org/rss/1.0/"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
         xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:content="http://purl.org/rss/1.0/modules/content/">

<channel rdf:about="http://base-art.net/Articles/113/">
<description>&lt;p&gt;A really nice feature every video player using GStreamer and playbin2
should have is media on-disk buffering. Even though it is supported
only for Quicktime and Flash videos currently it remains one good
improvement of the user experience if you are an avid consumer of
Apple trailers and flv :)&lt;/p&gt;
&lt;p&gt;Under the hood the magic is in queue2 and uridecodebin but you mostly
interface with playbin2. Here is the action plan:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Add the &amp;quot;download&amp;quot; flag to the playbin2 flags property&lt;/li&gt;
&lt;li&gt;Upon reception of GST_MESSAGE_BUFFERING messages on the bus, add an
idle source to the main loop (for instance)&lt;/li&gt;
&lt;li&gt;In that source create a gst_query_new_buffering() query with
GST_PERCENT_FORMAT format perform the query to playbin2&lt;/li&gt;
&lt;li&gt;Use gst_query_parse_buffering_range() to get the stop value and
compute the fill_status value&lt;/li&gt;
&lt;li&gt;Notify your UI of the fill level&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Additionally you can allow the user to save the buffered media for
later off-line consumption :) The media is buffered by queue2 in the
tmp folder, the exact file location, temp-location queue2 property,
can be retrieved by connecting to the &amp;quot;deep-notify::temp-location&amp;quot;
signal of playbin2. You also need to make sure that the temporary file
is removed when the user exits from your application, GStreamer
doesn't automatically take care of that, as far as I could see.&lt;/p&gt;
&lt;p&gt;This is what Totem does, as far as I could understand its code. This
is also how I implemented (&lt;a class="reference" href="https://bugs.webkit.org/show_bug.cgi?id=30004"&gt;yet to merge&lt;/a&gt;) it in WebKitGTK+:&lt;/p&gt;
&lt;a class="reference image-reference" href="/static/iron2_buffering.png"&gt;&lt;img alt="/static/iron2_buffering-thumb.png" src="/static/iron2_buffering-thumb.png" /&gt;&lt;/a&gt;
&lt;p&gt;And to provide a simple example I added this feature to the gst-python play.py example, available in a &lt;a class="reference" href="http://gist.github.com/271334"&gt;gist&lt;/a&gt; after the break!&lt;/p&gt;
</description>
<link>http://base-art.net/Articles/113/</link>
<title>Comments on article "GStreamer and on-disk videos buffering"</title>



<items>
<rdf:seq>

<rdf:li rdf:resource="http://base-art.net/Comments/294/"/>

<rdf:li rdf:resource="http://base-art.net/Comments/293/"/>

<rdf:li rdf:resource="http://base-art.net/Comments/292/"/>

<rdf:li rdf:resource="http://base-art.net/Comments/291/"/>

</rdf:seq>
</items>


</channel>


<item rdf:about="http://base-art.net/Comments/294/">
<dc:date>2010-01-29T00:39:34.000004+02:00</dc:date>
<title>rnr on GStreamer and on-disk videos buffering</title>
<link>http://base-art.net/Comments/294/</link>
<author>rnr</author>
<description>
&lt;p&gt;Nicely explained!&lt;/p&gt;

</description>
</item>

<item rdf:about="http://base-art.net/Comments/293/">
<dc:date>2010-01-23T06:42:33.000005+02:00</dc:date>
<title>Gabriel on GStreamer and on-disk videos buffering</title>
<link>http://base-art.net/Comments/293/</link>
<author>Gabriel</author>
<description>
&lt;p&gt;Great summary, thanks a lot!  Hopefully we'll get this into Banshee soon.&lt;/p&gt;

</description>
</item>

<item rdf:about="http://base-art.net/Comments/292/">
<dc:date>2010-01-22T22:56:09.000004+02:00</dc:date>
<title>avb on GStreamer and on-disk videos buffering</title>
<link>http://base-art.net/Comments/292/</link>
<author>avb</author>
<description>
&lt;p&gt;man, you the best :) Everybody is waiting for a full screen :)&lt;/p&gt;

</description>
</item>

<item rdf:about="http://base-art.net/Comments/291/">
<dc:date>2010-01-22T12:30:03.000004+02:00</dc:date>
<title>philn on GStreamer and on-disk videos buffering</title>
<link>http://base-art.net/Comments/291/</link>
<author>philn</author>
<description>
&lt;p&gt;One thing to note, GStreamer should remove the temp file if you reset the pipeline to GST_STATE_NULL or play another uri.&lt;/p&gt;
&lt;p&gt;Thanks to Bastien Nocera for the tip!&lt;/p&gt;

</description>
</item>


</rdf:RDF>