<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Laen Aggregated &#187; Projects</title>
	<atom:link href="http://www.laen.org/category/projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.laen.org</link>
	<description>Chaos is the raw material of order</description>
	<lastBuildDate>Sun, 17 Oct 2010 16:57:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Taking Pictures</title>
		<link>http://www.laen.org/2009/03/24/taking-pictures/</link>
		<comments>http://www.laen.org/2009/03/24/taking-pictures/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 00:25:57 +0000</pubDate>
		<dc:creator>Laen</dc:creator>
				<category><![CDATA[Front Page]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://www.laen.org/?p=2469</guid>
		<description><![CDATA[Here&#8217;s how to grab a single frame from a live video stream using GStreamer on Linux in Ruby. The trick is to use the &#8220;last_buffer&#8221; property on your video sink. That contains the last frame that was displayed to your screen. You can use RMagick to convert that into something you can use like this: [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to grab a single frame from a live video stream using GStreamer on Linux in Ruby.</p>

<p>The trick is to use the &#8220;last_buffer&#8221; property on your video sink.  That contains the last frame that was displayed to your screen.</p>

<p>You can use RMagick to convert that into something you can use like this:</p>



<pre>
#!/usr/bin/ruby

require 'gst'
require 'RMagick'

@pipe = Gst::Pipeline.new
@source = Gst::ElementFactory.make(&quot;v4l2src&quot;)
@sink    = Gst::ElementFactory.make(&quot;xvimagesink&quot;)
@pipe.add(@source,@sink)
@source &gt;&gt; @sink

@pipe.play

[ ... Later ... ]
# This is the actual capture.
capture = Image.from_blob(@sink.last_buffer.data).first

</pre>]]></content:encoded>
			<wfw:commentRss>http://www.laen.org/2009/03/24/taking-pictures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

