<?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>unixwiz &#187; ps3</title>
	<atom:link href="http://blogs.sungeek.net/unixwiz/tag/ps3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sungeek.net/unixwiz</link>
	<description>anything dealing with *NIX or what ever I want to write about</description>
	<lastBuildDate>Fri, 02 Jul 2010 02:28:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Mediatomb and Solaris 10</title>
		<link>http://blogs.sungeek.net/unixwiz/2009/06/13/mediatomb-and-solaris-10/</link>
		<comments>http://blogs.sungeek.net/unixwiz/2009/06/13/mediatomb-and-solaris-10/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 03:28:05 +0000</pubDate>
		<dc:creator>unixwiz</dc:creator>
				<category><![CDATA[Random Stuff]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Zones/Containers]]></category>
		<category><![CDATA[mediatomb]]></category>
		<category><![CDATA[ps3]]></category>
		<category><![CDATA[replaytv]]></category>

		<guid isPermaLink="false">http://blogs.sungeek.net/unixwiz/?p=1140</guid>
		<description><![CDATA[Now that I rebuilt the server, it was time to put media tomb on it to share media with the PS3. To get it to compile on Solaris (fresh 05/09 Update 7 install patched with the latest security and recommended patches), there are a couple of things you have to do (most of this is [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I rebuilt the server, it was time to put media tomb on it to share media with the PS3. To get it to compile on Solaris (fresh 05/09 Update 7 install patched with the latest security and recommended patches), there are a couple of things you have to do (most of this is from <a href="http://blogs.sun.com/constantin/entry/mediatomb_on_solaris">http://blogs.sun.com/constantin/entry/mediatomb_on_solaris</a> with some additional stuff I had to do:</p>
<p>1. Download the latest version of the &#8220;file&#8221; program from ftp://ftp.astron.com/pub/file/ (my case the current is 5.03)<br />
2. Unzip/untar the file<br />
3. Configure and run make:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d file<span class="nu0">-5.03</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf file<span class="nu0">-5.03</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> file<span class="nu0">-5.03</span><br />
./configure &#8211;<span class="re2">prefix=</span>/usr/<span class="kw3">local</span>/<span class="kw2">file</span><br />
<span class="kw2">gmake</span><br />
<span class="kw2">su</span> &#8211; root -c <span class="st0">&quot;gmake install&quot;</span></div>
</div>
<p>3. There are a bunch of other requirements for mediatomb, the easiest way to get them is to use www.blastwave.org. The packages that I installed are:<br />
 CSWbdb4<br />
 CSWbzip2<br />
 CSWcurl<br />
 CSWcurlrt<br />
 CSWexpat<br />
 CSWfaac<br />
 CSWfaad2<br />
 CSWfconfig<br />
 CSWffmpeg<br />
 CSWffmpeglib<br />
 CSWftype2<br />
 CSWgcc3corert<br />
 CSWgcc3g++rt<br />
 CSWgcrypt<br />
 CSWggettext<br />
 CSWgpgerr<br />
 CSWiconv<br />
 CSWid3lib<br />
 CSWimlib2<br />
 CSWisaexec<br />
 CSWlame<br />
 CSWliba52<br />
 CSWlibid3tag<br />
 CSWlibidn<br />
 CSWlibnet<br />
 CSWlibogg<br />
 CSWlibsdl<br />
 CSWlibssh2<br />
 CSWlibtool<br />
 CSWlibtoolrt<br />
 CSWlibx11<br />
 CSWlibxau<br />
 CSWlibxcb<br />
 CSWlibxdmcp<br />
 CSWncurses<br />
 CSWoldaprt<br />
 CSWossl<br />
 CSWossldevel<br />
 CSWosslrt<br />
 CSWosslutils<br />
 CSWpixman<br />
 CSWpng<br />
 CSWsasl<br />
 CSWsdlmixer<br />
 CSWsqlite3<br />
 CSWsqlite3dev<br />
 CSWstl4<br />
 CSWsunmath<br />
 CSWtaglibgcc<br />
 CSWtheora<br />
 CSWtiff<br />
 CSWungif<br />
 CSWvorbis<br />
 CSWxvid<br />
 CSWzlib</p>
<p>4. Once these are installed, you can download mediatomb and compile it. <a href="http://mediatomb.cc/pages/download">http://mediatomb.cc/pages/download</a></p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="kw2">gzip</span> -d mediatomb<span class="nu0">-0.11</span><span class="nu0">.0</span>.<span class="kw2">tar</span>.gz<br />
<span class="kw2">tar</span> -xvf mediatomb<span class="nu0">-0.11</span><span class="nu0">.0</span>.<span class="kw2">tar</span><br />
<span class="kw3">cd</span> mediatomb<span class="nu0">-0.11</span><span class="nu0">.0</span><br />
./configure &#8211;<span class="re2">prefix=</span>/mediatomb &#8211;enable-iconv-lib &#8211;with-iconv-<span class="re2">h=</span>/opt/csw/include &#8211;with-iconv-<span class="re2">libs=</span>/opt/csw/lib &#8211;enable-libmagic &#8211;with-magic-<span class="re2">h=</span>/usr/<span class="kw3">local</span>/<span class="kw2">file</span>/include &#8211;with-magic-<span class="re2">libs=</span>/usr/<span class="kw3">local</span>/<span class="kw2">file</span>/lib &#8211;with-taglib-<span class="re2">cfg=</span>/opt/csw/bin/taglib-config &#8211;with-curl-<span class="re2">cfg=</span>/opt/csw/bin/curl-config &#8211;with-sqlite3-<span class="re2">libs=</span>/opt/csw/lib &#8211;with-sqlite3-<span class="re2">h=</span>/opt/csw/include &#8211;with-<span class="re2">search=</span>/opt/csw &#8211;with-id3lib-<span class="re2">h=</span>/opt/csw/include &#8211;with-id3-<span class="re2">libs=</span>/opt/csw/lib<br />
<span class="kw2">gmake</span></div>
</div>
<p>However before you can run gmake, you need to edit a couple of files. One is the src/main.cc, you need to comment out lines 128 through 141. This is not needed for Solaris. The second file to edit is a result of this:</p>
<p>During the compile I got an error that looked like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">../src/url.<span class="kw2">cc</span>:<span class="nu0">78</span>:<span class="nu0">53</span>: macro <span class="st0">&quot;curl_easy_setopt&quot;</span> requires <span class="nu0">3</span> arguments, but only <span class="nu0">2</span> given<br />
../src/url.<span class="kw2">cc</span>: In member <span class="kw1">function</span> `zmm::Ref&lt;zmm ::StringBuffer&gt; URL::download<span class="br0">&#40;</span>zmm::String, long int*, CURL*, bool, bool, bool<span class="br0">&#41;</span><span class="st0">&#8216;:<br />
../src/url.cc:78: warning: statement is a reference, not call, to function `curl_easy_setopt&#8217;</span></div>
</div>
<p>To fix it edit the src/url.cc file and on line 78 change it from this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">curl_easy_setopt<span class="br0">&#40;</span>curl_handle, CURLOPT_NOBODY<span class="br0">&#41;</span>;</div>
</div>
<p>to this :</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">curl_easy_setopt<span class="br0">&#40;</span>curl_handle, CURLOPT_NOBODY, <span class="nu0">1</span><span class="br0">&#41;</span>;</div>
</div>
<p>Then rerun gmake . Once the compile is finished, su to root and do a gmake install, it will place all the media tomb stuff in /mediatomb. (I am using a Zone on a Solaris 10 machine so / has plenty of space).</p>
<p>I then created a user for mediatomb to be run under, so a user and group called mediatmb were created, and all the /mediatomb directories and files were changed to be owned by mediatmb</p>
<p>Once that was done, login as the mediatmb user and create a script in /mediatmb/bin with the following in it:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re2">LD_LIBRARY_PATH=</span>/opt/csw/lib:/usr/<span class="kw3">local</span>/<span class="kw2">file</span>/lib:/usr/sfw/lib<br />
<span class="kw3">export</span> LD_LIBRARY_PATH<br />
./mediatomb &#8211;ip x.x.x.x &#8211;port <span class="nu0">49194</span> &#8211;daemon &#8211;pidfile /tmp/mediatomb.pid &#8211;<span class="re2">logfile=</span>/tmp/mediatomb.log</div>
</div>
<p>where x.x.x.x is the IP address of the machine you are running it on. In Constantin&#8217;s blog, he mentioned also using the interface, but I found that it had problems since this was a zone. So instead of using the interface, I used the IP address of the zone.</p>
<p>The changes I made to the config.xml in the ~/.mediatomb directory are as follows:</p>
<div class="codesnip-container" >-bash-3.00$ diff orig-config.xml config.xml<br />
6a7<br />
&gt;       &lt;account user=&#8221;unixwiz&#8221; password=&#8221;video&#8221;/&gt;<br />
23c24<br />
&lt; &lt;protocolInfo extend=&#8221;no&#8221;/&gt;&lt;!&#8211; For PS3 support change to &#8220;yes&#8221; &#8211;&gt;<br />
&#8212;<br />
&gt;     &lt;protocolinfo extend=&#8221;yes&#8221;/&gt;&lt;!&#8211; For PS3 support change to &#8220;yes&#8221; &#8211;&gt;<br />
44a46<br />
&gt;     &lt;magic -file&gt;/usr/local/file/share/misc/magic.mgc&lt;/magic&gt;<br />
46a49,50<br />
&gt;       &lt;map from=&#8221;mpg&#8221; to=&#8221;video/mpeg&#8221;/&gt;<br />
&gt;       &lt;map from=&#8221;JPG&#8221; to=&#8221;image/jpeg&#8221;/&gt;<br />
61c65<br />
&lt; &lt;!&#8211; &lt;map from=&#8221;avi&#8221; to=&#8221;video/divx&#8221;/&gt; &#8211;&gt;<br />
&#8212;<br />
&gt;         &lt;map from=&#8221;avi&#8221; to=&#8221;video/divx&#8221;/&gt;</div>
<p>Now all you have to do is login to the web interface and add the media, following mediatomb&#8217;s documentation.</p>
<p>Some interesting things I have found with it:</p>
<p>1. If your PS3 is on wireless it may have problems streaming mp4, but not mpeg2. Weird I know as the mpeg2 was solid streaming at 370kb/s, but it couldn&#8217;t handle the mp4. Switching to a hardwired connection fixed that problem.</p>
<p>2. If you happen to be a ReplayTV user [cause TiVO is a wanna be replay <img src='http://blogs.sungeek.net/unixwiz/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ] you can use MediaTomb in conjunction with <a href="http://dvarchive.org/">DVArchive</a>, which also runs nicely in my Solaris zone. Just point a media directory at the Local_Guide directory and mediatomb will stream every MPEG2 file in that directory to your PS3. Which is pretty damn cool.</p>
<p>3. The PS3 is very pickly about it&#8217;s mp4 type files. Some that I made with <a href="http://handbrake.fr/">handbrake</a> don&#8217;t work, but ones I did with <a href="http://www.ffmpegx.com/">ffmpegx</a> worked once I put the hardwired connection in. </p>
<p>4. I have not tried any of the transcoding stuff. I would rather do that before and not bog down my server doing that.</p>
<p>5. I need to do a lot of reading on how to make folders and the such so that my collection is organized and not just all under one directory.</p>
<p>For those interested:<br />
My compile environment is setup like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re2">PATH=</span>/bin:/sbin:/usr/bin:/usr/sbin:/usr/sfw/bin:/usr/ccs/bin:/usr/<span class="kw3">local</span>/bin:/opt/csw/bin<br />
<span class="re2">SHELL=</span>/bin/tcsh</div>
</div>
<p></zmm></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sungeek.net/unixwiz/2009/06/13/mediatomb-and-solaris-10/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
