<?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>Angel's Blog &#187; Linux / Unix</title>
	<atom:link href="http://mindmist.com/blog/category/linux-unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://mindmist.com/blog</link>
	<description>Someone right now is looking pretty tired, staring at a laptop trying to get inspired...</description>
	<lastBuildDate>Fri, 11 Sep 2009 12:21:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FLV steaming &#8211; server/client side</title>
		<link>http://mindmist.com/blog/12/10/2008/flv-steaming-serverclient-side/</link>
		<comments>http://mindmist.com/blog/12/10/2008/flv-steaming-serverclient-side/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 20:49:02 +0000</pubDate>
		<dc:creator>Angel</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Everything else]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[flv]]></category>
		<category><![CDATA[httpd]]></category>
		<category><![CDATA[jw player for flash]]></category>
		<category><![CDATA[stream]]></category>
		<category><![CDATA[streaming]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mindmist.com/blog/?p=92</guid>
		<description><![CDATA[This is the shortest how-to ever. You won&#8217;t get any extra info, the idea is to install the whole scheme fast as possible and then spend some time reading docs for each separate module.
This is how to make HTTP FLV streaming using the JW FLV Media Player and the lighttpd web server.
Here we go:
1. Installation
Install [...]]]></description>
			<content:encoded><![CDATA[<p>This is the shortest how-to ever. You won&#8217;t get any extra info, the idea is to install the whole scheme fast as possible and then spend some time reading docs for each separate module.<br />
This is how to make HTTP FLV streaming using the <a href="http://www.jeroenwijering.com/" target="_blank">JW FLV Media Player</a> and the <a href="http://www.lighttpd.net/" target="_blank">lighttpd web server</a>.<br />
Here we go:<br />
<span style="text-decoration: underline;"><strong>1. Installation</strong></span><br />
Install the lighttpd server. I am using Ubuntu, so i will install it via the apt-get package system:</p>
<p><code>sudo apt-get install lighttpd</code></p>
<p><span style="text-decoration: underline;"><strong>2. Configuration</strong></span></p>
<p>The first we have to do is change the default listening port to 81 (optional if you are already using apache on the same host, or whatever you decide to use) and enable the needed for flv streaming modules (<strong>mod_flv_streaming </strong> and <strong>mod_secdownload</strong> ). Edit the following file : /etc/lighttpd/lighttpd.conf and change the server.modules and the server.port parameters:</p>
<div class="geshi no html">
<ol>
<li class="li1">
<div class="de1">server.modules = (
</div>
</li>
<li class="li1">
<div class="de1">&quot;mod_access&quot;,
</div>
</li>
<li class="li1">
<div class="de1">&quot;mod_alias&quot;,
</div>
</li>
<li class="li1">
<div class="de1">&quot;mod_accesslog&quot;,
</div>
</li>
<li class="li1">
<div class="de1">&quot;mod_compress&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_rewrite&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_redirect&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_status&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_evhost&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_usertrack&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_rrdtool&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_webdav&quot;,
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_expire&quot;,
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &quot;mod_flv_streaming&quot;,
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &quot;mod_secdownload&quot;, ## optional
</div>
</li>
<li class="li1">
<div class="de1"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;mod_evasive&quot;
</div>
</li>
<li class="li1">
<div class="de1">)
</div>
</li>
<li class="li1">
<div class="de1">flv-streaming.extensions = ( &quot;.flv&quot;)</div>
</li>
</ol>
</div>
<p>and</p>
<div class="geshi no html">
<ol>
<li class="li1">
<div class="de1">## bind to port (default: 80)
</div>
</li>
<li class="li1">
<div class="de1">server.port = 81</div>
</li>
</ol>
</div>
<p>Then start the lighttpd server ( Ubuntu )</p>
<p><code>sudo /etc/init.d/lighttpd start </code></p>
<p><span style="text-decoration: underline;"><strong>3.1 Converting regulat video clips into .flv</strong></span></p>
<p>Before compiling the ffmpeg binary, you have to download and install some development libraries. Please install liblame-dev and libvorbis-dev and all their dependencies:</p>
<p><code>apt-get install liblame-dev</code></p>
<p><code>apt-get install libvorbis-dev</code></p>
<p>Then go to your favorite source folder and download there the current svn server of ffmpeg</p>
<p><code>cd /usr/local/src/</code></p>
<p>If you don&#8217;t have subversion installed:</p>
<p><code>apt-get install subversion</code></p>
<p>Download the source code:</p>
<p><code>svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg</code></p>
<p>Open the downloaded directory:</p>
<p><code>cd ffmpeg/</code></p>
<p>and compile the ffmpeg binary with the following keys</p>
<div class="code">./configure &#8211;enable-shared &#8211;prefix=/usr &#8211;enable-gpl  &#8211;enable-pthreads &#8211;enable-libmp3lame &#8211;enable-libvorbis</div>
<p><code>make</code></p>
<p>Wait a lot of time &#8230;</p>
<p>and finally install it :</p>
<p><code>make install</code></p>
<p> 2. Converting movies<br />
Lets create two separate folders for &#8220;ready to be streamed movies&#8221; and &#8220;unconverted movies&#8221;</p>
<p><code>mkdir /var/www/movies/</code></p>
<p><code>mkdir /var/www/movies/convert_me/</code></p>
<p><code>mkdir /var/www/movies/flv/</code></p>
<p>Copy a favorite movie or clip in /var/www/movies/convert_me/ and then execute:</p>
<div class="code">ffmpeg -i /var/www/movies/convert_me/myclip.avi -s 320&#215;240 -ar 44100 -r 12 /var/www/movies/flv/myclip.flv</div>
<p><span style="text-decoration: underline;"><strong>3.2 FLV files</strong></span></p>
<p>You have to prepare your flv for streaming. I am not really a video encoding/decoding guru, so i am sharing my solution to the problem, but i am not sure it is the best possible.</p>
<p>Install flvtool2:</p>
<p><code>sudo apt-get install flvtool2</code></p>
<p>Put some flv movie somewhere inside your DocumentRoot folder ( for example /var/www/path/clip.flv) and then use the flvtool2 to generate the needed for the server meta-tags inside your flv video.</p>
<p><code>flvtool2 -U -p /var/www/path/clip.flv</code></p>
<p>Here i am using two keys :<br />
-U <em>Updates FLV with an onMetaTag event</em><br />
-p <em>Preserve mode only updates FLVs that have not been processed before</em><br />
another interesting switch for whole folders will be :<br />
-r <em>Recursion for directory processing</em></p>
<p>As you may notice, the flvtool2 don&#8217;t have so many options at all, so it will be good to make a little more research about the features of this tool.<br />
You can test the generated meta tags using the debug command in flvtool2.</p>
<p><code> flvtool2 -D clip.flv </code></p>
<p>Be prepared for a lot of output&#8230; It looks like this :</p>
<div class="geshi no html">
<ol>
<li class="li1">
<div class="de1">#1 Meta Tag (onMetaData): timestamp 0, size 7910, data size 7899
</div>
</li>
<li class="li1">
<div class="de1">#2 Audio Tag: timestamp 0, size 274, data size 263
</div>
</li>
<li class="li1">
<div class="de1">#3 Audio Tag: timestamp 26, size 274, data size 263
</div>
</li>
<li class="li1">
<div class="de1">#4 Video Tag (Keyframe): timestamp 38, size 39766, data size 39755
</div>
</li>
<li class="li1">
<div class="de1">#5 Audio Tag: timestamp 52, size 274, data size 263
</div>
</li>
<li class="li1">
<div class="de1">#6 Video Tag (Interframe): timestamp 71, size 5289, data size 5278
</div>
</li>
<li class="li1">
<div class="de1">#7 Audio Tag: timestamp 78, size 274, data size 263
</div>
</li>
<li class="li1">
<div class="de1">#8 Audio Tag: timestamp 104, size 274, data size 263
</div>
</li>
<li class="li1">
<div class="de1">#9 Video Tag (Interframe): timestamp 105, size 4334, data size 4323
</div>
</li>
<li class="li1">
<div class="de1">#10 Audio Tag: timestamp 130, size 274, data size 263</div>
</li>
</ol>
</div>
<p>Now your clip.flv is ready to be streamed.</p>
<p><span style="text-decoration: underline;"><strong>4. FLV Client Player</strong></span></p>
<p>Download the JW FLV Media Player from <a href="http://www.jeroenwijering.com/" target="_blank">http://www.jeroenwijering.com/</a> and unpack the archive somewhere in your www directory. Create a html file in the same directory as your player with the following source:</p>
<div class="geshi no html">
<ol>
<li class="li1">
<div class="de1">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;head&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;&lt;title&gt;JW Player for Flash&lt;/title&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/head&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;body&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;&lt;div id=&quot;container&quot;&gt;&lt;a href=&quot;http://www.macromedia.com/go/getflashplayer&quot;&gt;Get the Flash Player&lt;/a&gt; to see this player.&lt;/div&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;&lt;script type=&quot;text/javascript&quot; src=&quot;swfobject.js&quot;&gt;&lt;/script&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;&lt;script type=&quot;text/javascript&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; var s1 = new SWFObject(&quot;player.swf&quot;,&quot;ply&quot;,&quot;328&quot;,&quot;200&quot;,&quot;9&quot;,&quot;#FFFFFF&quot;);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; s1.addParam(&quot;allowfullscreen&quot;,&quot;true&quot;);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; s1.addParam(&quot;allowscriptaccess&quot;,&quot;always&quot;);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; s1.addParam(&#39;wmode&#39;,&#39;opaque&#39;);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; s1.addParam(&#39;flashvars&#39;,&#39;file=http://your_lighttpd_server.com:81/path/clip.flv&amp;streamer=lighttpd&#39;);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; s1.write(&quot;container&quot;);
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;&lt;/script&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/body&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/html&gt;</div>
</li>
</ol>
</div>
<p>Save it as test_stream.html and open it with your web browser ( http://your_lighttpd_server.com:81/path/mediaplayer/test_stream.html). If your paths are correct you will be able to watch your clip.flv with the flv player.<br />
In this example i am using the same server (lighttpd) for hosting the flv player and the clip, but it is possible another webserver to be used. For example you can host your site on Apache and use lighttpd only for storing the streamed videos!</p>
<p><img class="alignnone size-full wp-image-107" title="flv_player" src="http://mindmist.com/blog/wp-content/uploads/2008/10/flv_player.gif" alt="" width="342" height="212" /></p>
<p><span style="text-decoration: underline;"><strong>5. Some technical information to help you understand the idea</strong></span><br />
Let&#8217;s take more detailed view of the JW Player&#8217;s configuration:</p>
<div class="geshi no javascript">
<ol>
<li class="li1">
<div class="de1">s1.<span class="me1">addParam</span><span class="br0">&#40;</span><span class="st0">&#39;flashvars&#39;</span>,<span class="st0">&#39;file=http://your_lighttpd_server.com:81/path/clip.flv&amp;streamer=lighttpd&#39;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
<p>Whe have two parameters:<br />
file = link to the flv file we want to stream<br />
streamer = lighttpd<br />
With the second parameter we are activating the native flv stream support in the lighttpd server. After you start the playback of the video and forward to a spot that has not been downloaded yes, you will notice that another parameter will be passed to the flv file :<br />
start = # of frame to start (here is where the meta tags we generated with flvtool2 are used to index the frames in the flv file). The lighttpd parse all the requests to the flv file and starts the streaming from the requested frame.</p>
<p><img class="alignnone size-full" title="firebug" src="http://mindmist.com/blog/wp-content/uploads/2008/10/flv_stream_firebug.gif"/></p>
<p>That&#8217;s all folks.</p>
<p>For more info, here is where i got the info for this mini-how-to from:</p>
<p><a href="http://www.jeroenwijering.com/?item=JW_FLV_Media_Player" target="_blank">http://www.jeroenwijering.com/?item=JW_FLV_Media_Player</a><br />
<a href="http://www.jeroenwijering.com/?item=HTTP_Video_Streaming" target="_blank">http://www.jeroenwijering.com/?item=HTTP_Video_Streaming</a><br />
<a href="http://www.inlet-media.de/flvtool2" target="_blank">http://www.inlet-media.de/flvtool2</a><br />
<a href="http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd" target="_blank">http://blog.lighttpd.net/articles/2006/03/09/flv-streaming-with-lighttpd</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mindmist.com/blog/12/10/2008/flv-steaming-serverclient-side/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My latest child &#8211; Orange II</title>
		<link>http://mindmist.com/blog/14/05/2008/my-latest-child-orange-ii/</link>
		<comments>http://mindmist.com/blog/14/05/2008/my-latest-child-orange-ii/#comments</comments>
		<pubDate>Wed, 14 May 2008 01:58:49 +0000</pubDate>
		<dc:creator>Angel</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux / Unix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://mindmist.com/blog/?p=27</guid>
		<description><![CDATA[As I used to live in Bulgaria, I always had an own webserver at home. And now, after 5 years working on a local installed XAMPP on my Windows box or even worst &#8211; working on the fly on customer&#8217;s server, I got my own server again. Got the hardware from ebay.de :

Pentium 4  [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">As I used to live in Bulgaria, I always had an own webserver at home. And now, after 5 years working on a local installed XAMPP on my Windows box or even worst &#8211; working on the fly on customer&#8217;s server, I got my own server again. Got the hardware from ebay.de :</p>
<p style="text-align: center;"><img class="alignnone size-medium wp-image-28" title="hp_epc42" src="http://mindmist.com/blog/wp-content/uploads/2008/05/hp_epc42.jpg" alt="" width="298" height="245" /></p>
<p style="text-align: left;">Pentium 4  &#8211; 1 ghz, 128 + 256 RAM, 20 GB hdd SCSI + 2&#215;500GB RAID (USB external storage) and etc.</p>
<p style="text-align: left;">The distribution is Ubuntu 8.04 Server Edition. I took me only about 4-5 hours to set everything &#8211; Apache, mySQL,php, Subversion. I can only recommend Ubuntu for small servers and other low-cost solutions <img src='http://mindmist.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://mindmist.com/blog/14/05/2008/my-latest-child-orange-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Linux features &#8230; can&#8217;t believe it (Ubuntu upgrade)</title>
		<link>http://mindmist.com/blog/26/04/2008/new-linux-features-can-believe-it-ubuntu-upgrade/</link>
		<comments>http://mindmist.com/blog/26/04/2008/new-linux-features-can-believe-it-ubuntu-upgrade/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 00:43:03 +0000</pubDate>
		<dc:creator>Angel</dc:creator>
				<category><![CDATA[Linux / Unix]]></category>

		<guid isPermaLink="false">http://mindmist.com/blog/?p=18</guid>
		<description><![CDATA[Today i was really nicely surprised. Since my girlfriend became an Linux user I can say &#8211; &#8220;Good work dear Linux community! Finally a OTB Desktop solution !&#8221; Because of the shitty video drivers from AMD/ATI and my video cart &#8211; ATI X1650 pro I can&#8217;t fully enjoy the Linux desktop experience but i am [...]]]></description>
			<content:encoded><![CDATA[<p>Today i was really nicely surprised. Since my girlfriend became an Linux user I can say &#8211; &#8220;Good work dear Linux community! Finally a OTB Desktop solution !&#8221; Because of the shitty video drivers from AMD/ATI and my video cart &#8211; ATI X1650 pro I can&#8217;t fully enjoy the Linux desktop experience but i am close to one <img src='http://mindmist.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Today I was just about to upgrade her Ubuntu Linux to the newest version &#8211; 8.04 LTS and i was ready to edit the APT source files but then i checked the software update application and i was fully surprised to find there easiest core version upgrade ever&#8230;</p>
<p><a rel="lightbox[ubuntu]" href="http://mindmist.com/blog/wp-content/uploads/2008/04/screenshot.png"><img class="alignnone size-thumbnail wp-image-19" title="Ubuntu upgrade" src="http://mindmist.com/blog/wp-content/uploads/2008/04/screenshot-150x150.png" alt="" width="150" height="150" /></a> <a rel="lightbox[ubuntu]" href="http://mindmist.com/blog/wp-content/uploads/2008/04/screenshot-distribution-upgrade.png"><img class="alignnone size-thumbnail wp-image-20" title="screenshot-distribution-upgrade" src="http://mindmist.com/blog/wp-content/uploads/2008/04/screenshot-distribution-upgrade-150x150.png" alt="" width="150" height="150" /></a></p>
<p>After so many years of editing source and config files,manually applying patches, compiling kernels again and again, here we are &#8211; <strong>a single click upgrade</strong> =&gt; no more install CDs, no more reading forums &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://mindmist.com/blog/26/04/2008/new-linux-features-can-believe-it-ubuntu-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
